70_PIONEERAVR.pm: addressed an issue with the reading display and jsonlist/jsonlist2

git-svn-id: https://svn.fhem.de/fhem/trunk@9683 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
hofrichter
2015-10-26 01:36:00 +00:00
parent e0dbe3b73d
commit b9c20a3354

View File

@@ -39,7 +39,6 @@
# match for devices/Dispatch() ???
# random/repeat attributes
# remote control layout (dynamic depending on available/current input?)
# handle special chars in display
# suppress the "on" command if networkStandby = "off"
#
@@ -913,6 +912,266 @@ PIONEERAVR_Define($$) {
"99"=>"(Indeterminate)"
};
# translation for chars (for the display)
$hash->{helper}{CHARS} = {
"00"=>" ",
"01"=>" ",
"02"=>" ",
"03"=>" ",
"04"=>" ",
"05"=>"[)",
"06"=>"(]",
"07"=>"I",
"08"=>"II",
"09"=>"<",
"0A"=>">",
"0B"=>"_",
"0C"=>".",
"0D"=>".0",
"0E"=>".5",
"0F"=>"Ω",
"10"=>"0",
"11"=>"1",
"12"=>"2",
"13"=>"3",
"14"=>"4",
"15"=>"5",
"16"=>"6",
"17"=>"7",
"18"=>"8",
"19"=>"9",
"1A"=>"A",
"1B"=>"B",
"1C"=>"C",
"1D"=>"F",
"1E"=>"M",
"1F"=>"¯",
"20"=>" ",
"21"=>"!",
"22"=>" ",
"23"=>"#",
"24"=>"\$",
"25"=>"%",
"26"=>"&",
"27"=>" ",
"28"=>"(",
"29"=>")",
"2A"=>"*",
"2B"=>"+",
"2C"=>",",
"2D"=>"-",
"2E"=>".",
"2F"=>"/",
"30"=>"0",
"31"=>"1",
"32"=>"2",
"33"=>"3",
"34"=>"4",
"35"=>"5",
"36"=>"6",
"37"=>"7",
"38"=>"8",
"39"=>"9",
"3A"=>":",
"3B"=>";",
"3C"=>"<",
"3D"=>"=",
"3E"=>">",
"3F"=>"?",
"40"=>"@",
"41"=>"A",
"42"=>"B",
"43"=>"C",
"44"=>"D",
"45"=>"E",
"46"=>"F",
"47"=>"G",
"48"=>"H",
"49"=>"I",
"4A"=>"J",
"4B"=>"K",
"4C"=>"L",
"4D"=>"M",
"4E"=>"N",
"4F"=>"O",
"50"=>"P",
"51"=>"Q",
"52"=>"R",
"53"=>"S",
"54"=>"T",
"55"=>"U",
"56"=>"V",
"57"=>"W",
"58"=>"X",
"59"=>"Y",
"5A"=>"Z",
"5B"=>"[",
"5C"=>" ",
"5D"=>"]",
"5E"=>"^",
"5F"=>"_",
"60"=>"||",
"61"=>"a",
"62"=>"b",
"63"=>"c",
"64"=>"d",
"65"=>"e",
"66"=>"f",
"67"=>"g",
"68"=>"h",
"69"=>"i",
"6A"=>"j",
"6B"=>"k",
"6C"=>"l",
"6D"=>"m",
"6E"=>"n",
"6F"=>"o",
"70"=>"p",
"71"=>"q",
"72"=>"r",
"73"=>"s",
"74"=>"t",
"75"=>"u",
"76"=>"v",
"77"=>"w",
"78"=>"x",
"79"=>"y",
"7A"=>"z",
"7B"=>"{",
"7C"=>"|",
"7D"=>"}",
"7E"=>"~",
"7F"=>" ",
"80"=>"Œ",
"81"=>"œ",
"82"=>"IJ",
"83"=>"ij",
"84"=>"π",
"85"=>" ",
"86"=>" ",
"87"=>" ",
"88"=>" ",
"89"=>" ",
"8A"=>" ",
"8B"=>" ",
"8C"=>"←",
"8D"=>"↑",
"8E"=>"→",
"8F"=>"↓",
"90"=>"+",
"91"=>"♪",
"92"=>" ",
"93"=>" ",
"94"=>" ",
"95"=>" ",
"96"=>" ",
"97"=>" ",
"98"=>" ",
"99"=>" ",
"9A"=>" ",
"9B"=>" ",
"9C"=>" ",
"9D"=>" ",
"9E"=>" ",
"9F"=>" ",
"A0"=>" ",
"A1"=>"¡",
"A2"=>"¢",
"A3"=>"£",
"A4"=>"¤",
"A5"=>"¥",
"A6"=>"¦",
"A7"=>"§",
"A8"=>"¨",
"A9"=>"©",
"AA"=>"ª",
"AB"=>"«",
"AC"=>"¬",
"AD"=>"-",
"AE"=>"®",
"AF"=>"¯",
"B0"=>"°",
"B1"=>"±",
"B2"=>"²",
"B3"=>"³",
"B4"=>"´",
"B5"=>"µ",
"B6"=>"¶",
"B7"=>"·",
"B8"=>"¸",
"B9"=>"¹",
"BA"=>"º",
"BB"=>"»",
"BC"=>"¼",
"BD"=>"½",
"BE"=>"¾",
"BF"=>"¿",
"C0"=>"À",
"C1"=>"Á",
"C2"=>"Â",
"C3"=>"Ã",
"C4"=>"Ä",
"C5"=>"Å",
"C6"=>"Æ",
"C7"=>"Ç",
"C8"=>"È",
"C9"=>"É",
"CA"=>"Ê",
"CB"=>"Ë",
"CC"=>"Ì",
"CD"=>"Í",
"CE"=>"Î",
"CF"=>"ï",
"D0"=>"Ð",
"D1"=>"Ñ",
"D2"=>"Ò",
"D3"=>"Ó",
"D4"=>"Ô",
"D5"=>"Õ",
"D6"=>"Ö",
"D7"=>"×",
"D8"=>"Ø",
"D9"=>"Ù",
"DA"=>"Ú",
"DB"=>"Û",
"DC"=>"Ü",
"DD"=>"Ý",
"DE"=>"Þ",
"DF"=>"ß",
"E0"=>"à",
"E1"=>"á",
"E2"=>"â",
"E3"=>"ã",
"E4"=>"ä",
"E5"=>"å",
"E6"=>"æ",
"E7"=>"ç",
"E8"=>"è",
"E9"=>"é",
"EA"=>"ê",
"EB"=>"ë",
"EC"=>"ì",
"ED"=>"í",
"EE"=>"î",
"EF"=>"ï",
"F0"=>"ð",
"F1"=>"ñ",
"F2"=>"ò",
"F3"=>"ó",
"F4"=>"ô",
"F5"=>"õ",
"F6"=>"ö",
"F7"=>"÷",
"F8"=>"ø",
"F9"=>"ù",
"FA"=>"ú",
"FB"=>"û",
"FC"=>"ü",
"FD"=>"ý",
"FE"=>"þ",
"FF"=>"ÿ"
};
$hash->{helper}{CLEARONINPUTCHANGE} = {
"00"=>"screenLine01",
"01"=>"screenLine02",
@@ -2068,8 +2327,11 @@ sub PIONEERAVR_Read($)
Log3 $hash,5,"PIONEERAVR $name: ".dq($line) ." interpreted as: MCACC memory: selected memory is: $2";
# Display updates
# uses a translation table for each letter (char) to display the letters properly
} elsif ( substr($line,0,2) eq "FL" ) {
my $display = pack("H*",substr($line,4,28));
my $hex = substr($line,4,28);
my @a = map $hash->{helper}{CHARS}->{$_}, $hex =~ /(..)/g;
my $display = join('',@a);
readingsBulkUpdate($hash, "displayPrevious", ReadingsVal($name,"display","") );
readingsBulkUpdate($hash, "display", $display );
Log3 $hash,5,"PIONEERAVR $name: ".dq($line) ." interpreted as: Display update to: $display";