diff --git a/fhem/CHANGED b/fhem/CHANGED index 77ff6b8c6..12ec5faaa 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: LGTV_IP12: new reading "power" + - change: LGTV_IP12: changed values of mute reading from true/false to on/off - bugfix: 30_MilightBridge: suppress protocol change message on startup - bugfix: 74_Unifi.pm: Changed unsupported character for AP and UC readings from hash to hyphen. diff --git a/fhem/FHEM/82_LGTV_IP12.pm b/fhem/FHEM/82_LGTV_IP12.pm index 1293bc7ed..2052d1ab3 100755 --- a/fhem/FHEM/82_LGTV_IP12.pm +++ b/fhem/FHEM/82_LGTV_IP12.pm @@ -404,16 +404,19 @@ LGTV_IP12_ParseHttpResponse($$$) { readingsSingleUpdate($hash, $cmd, $arg, 1); LGTV_IP12_ResetTimer($hash, 2); + return; } } + readingsBeginUpdate($hash); # if an error was occured, raise a log entry if($err ne "") { Log3 $name, 5, "LGTV_IP12 ($name) - could not execute command \"$cmd".(defined($arg) ? " ".(split("\\|", $arg))[0] : "")."\" - $err"; - readingsSingleUpdate($hash, "state", "off", 1); + readingsBulkUpdate($hash, "state", "off"); + readingsBulkUpdate($hash, "power", "off"); } # if the response contains data, examine it. @@ -421,11 +424,12 @@ LGTV_IP12_ParseHttpResponse($$$) { Log3 $name, 5, "LGTV_IP12 ($name) - got response for \"$cmd".(defined($arg) ? " ".(split("\\|", $arg))[0] : "")."\": $data"; - readingsSingleUpdate($hash, "state", "on", 1); + readingsBulkUpdate($hash, "state", "on"); + readingsBulkUpdate($hash, "power", "on"); if($cmd eq "statusRequest") { - readingsBeginUpdate($hash); + if($arg eq "volumeInfo") { @@ -436,7 +440,7 @@ LGTV_IP12_ParseHttpResponse($$$) if($data =~ /(.+?)<\/mute>/) { - readingsBulkUpdate($hash, "mute", $1); + readingsBulkUpdate($hash, "mute", ($1 eq "true" ? "on" : "off")); } } @@ -491,11 +495,11 @@ LGTV_IP12_ParseHttpResponse($$$) } } - readingsEndUpdate($hash, 1); - LGTV_IP12_RetrieveChannelList($hash) if(not exists($hash->{helper}{CHANNEL_LIST})); } } + + readingsEndUpdate($hash, 1); } # executes a http request with or without data and starts the HTTP request non-blocking to avoid timing problems for other modules (e.g. HomeMatic) @@ -757,6 +761,7 @@ sub LGTV_IP12_html2txt($)
  • input - The current input source (e.g. Antenna, Sattelite, HDMI1, ...)
  • inputLabel - The user defined name of the current input source
  • mute - Reports the current mute state (can be "on" or "off")
  • +
  • power - The power status (can be "on" or "off")
  • volume - Reports the volume state.
  • @@ -856,6 +861,7 @@ sub LGTV_IP12_html2txt($)
  • input - Die aktuelle Eingangsquelle (z.B. Antenna, Sattelite, HDMI1, ...)
  • inputLabel - Die benutzerdefinierte Bezeichnung der aktuellen Eingangsquelle
  • mute on,off - Der aktuelle Stumm-Status ("on" => Stumm, "off" => Laut)
  • +
  • power on,off - Der aktuelle Power-Status ("on" => eingeschaltet, "off" => ausgeschaltet)
  • volume - Der aktuelle Lautstärkepegel.