98_Verkehrsinfo.pm:Fix state update, Hessenschau message

git-svn-id: https://svn.fhem.de/fhem/trunk@12896 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martins
2016-12-28 01:32:21 +00:00
parent 4411b75cd0
commit ce89ae96dc
2 changed files with 17 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # Do not insert empty lines here, update check depends on it.
- bugfix: 98_Verkehrsinfo.pm: Fix state update, Hessenschau message
- feature: 50_TelegramBot: msgForceReply, disable, - feature: 50_TelegramBot: msgForceReply, disable,
keyboards in messages, inline keyboards and dialogs keyboards in messages, inline keyboards and dialogs
- bugfix: 74_NUKIDevice: Fix Problem with battery Reading - bugfix: 74_NUKIDevice: Fix Problem with battery Reading

View File

@@ -25,6 +25,14 @@
############################################################################ ############################################################################
# #
# Changelog: # Changelog:
# 2016-12-26, v2.1
# Bugfix: update state with readings update
# CHANGE: update commandref with link to readingFn-Attributen
#
# Changelog:
# 2016-12-13, v2.0RC1
# Bugfix: Bugfix Hessenschau Message
#
# 2016-11-17, v2.0 # 2016-11-17, v2.0
# CHANGE: Module change to HttpNonBlocking # CHANGE: Module change to HttpNonBlocking
# CHANGE: remove requirement perl-module json # CHANGE: remove requirement perl-module json
@@ -153,7 +161,7 @@ sub Verkehrsinfo_Define($$) {
InternalTimer(gettimeofday()+4, "Verkehrsinfo_GetUpdate", $hash, 0); InternalTimer(gettimeofday()+4, "Verkehrsinfo_GetUpdate", $hash, 0);
$hash->{STATE} = 'initialized'; readingsSingleUpdate($hash, "state", 'initialized',1 );
return undef; return undef;
} }
@@ -168,7 +176,7 @@ sub Verkehrsinfo_HttpNbDefineZone($) {
if($err ne "") { if($err ne "") {
Log3 $name, 3, "error while requesting ".$param->{url}." - $err"; Log3 $name, 3, "error while requesting ".$param->{url}." - $err";
$hash->{STATE} = 'ERROR Update Zone ' . FmtDateTime(time()); readingsSingleUpdate($hash, "state", 'ERROR Update Zone ' . FmtDateTime(time()), 1);
} }
elsif($content ne "") elsif($content ne "")
@@ -233,7 +241,6 @@ sub Verkehrsinfo_Set($@) {
if(!defined($Verkehrsinfo_gets{$opt})) { if(!defined($Verkehrsinfo_gets{$opt})) {
return "Unknown argument $opt, choose one of update:noArg"; return "Unknown argument $opt, choose one of update:noArg";
} }
$hash->{STATE} = $Verkehrsinfo_gets{$opt} = $value;
if ($opt eq "update"){ if ($opt eq "update"){
Verkehrsinfo_GetUpdate($hash); Verkehrsinfo_GetUpdate($hash);
@@ -283,7 +290,7 @@ sub Verkehrsinfo_HttpNbUpdateData ($) {
if($err ne "") { if($err ne "") {
Log3 $name, 3, "error while requesting ".$param->{url}." - $err"; Log3 $name, 3, "error while requesting ".$param->{url}." - $err";
$hash->{STATE} = 'ERROR Update Readings ' . FmtDateTime(time()); readingsSingleUpdate($hash, "state", 'ERROR Update Readings ' . FmtDateTime(time()), 1);
} }
elsif($content ne "") elsif($content ne "")
@@ -392,6 +399,8 @@ sub Verkehrsinfo_HttpNbUpdateData ($) {
} }
$dataarray->{'message'} = $message_head . ' ' . $message; $dataarray->{'message'} = $message_head . ' ' . $message;
$dataarray->{'message'} =~ s/\<pre\>//;
$dataarray->{'message'} =~ s/\<\/pre\>//;
$dataarray->{'count'} = $i - 1; $dataarray->{'count'} = $i - 1;
@@ -409,9 +418,8 @@ sub Verkehrsinfo_HttpNbUpdateData ($) {
Log3 $hash, 4, "Verkehrsinfo: ($name) ReadingsUpdate: $readingName - ".$dataarray->{$readingName}; Log3 $hash, 4, "Verkehrsinfo: ($name) ReadingsUpdate: $readingName - ".$dataarray->{$readingName};
readingsBulkUpdate($hash,$readingName,$dataarray->{$readingName}); readingsBulkUpdate($hash,$readingName,$dataarray->{$readingName});
} }
readingsBulkUpdate($hash, "state", 'update ' . FmtDateTime(time()));
readingsEndUpdate($hash, 1); readingsEndUpdate($hash, 1);
$hash->{STATE} = 'update ' . FmtDateTime(time());
} }
Log3 $hash, 4, "Verkehrsinfo: ($name) Verkehrsinfo_HttpNbUpdateData done"; Log3 $hash, 4, "Verkehrsinfo: ($name) Verkehrsinfo_HttpNbUpdateData done";
@@ -580,6 +588,7 @@ sub Verkehrsinfo_hf_orderby ($@) {
Multiple searching keywords can be seperated with the pipe "|".<br><br></li> Multiple searching keywords can be seperated with the pipe "|".<br><br></li>
<li><i>msg_format [ road | head | both ]</i> (Nur Verkehrsinfo.de)<br> <li><i>msg_format [ road | head | both ]</i> (Nur Verkehrsinfo.de)<br>
Using this parameter you can format the output, regarding streets, direction or both.<br><br></li> Using this parameter you can format the output, regarding streets, direction or both.<br><br></li>
<li><i><a href="#readingFnAttributes">readingFnAttributes</a></i><br><br></li>
</ul> </ul>
</ul> </ul>
<br> <br>
@@ -705,6 +714,7 @@ sub Verkehrsinfo_hf_orderby ($@) {
Mehrer Suchbegriffe können mit einer Pipe "|" getrennt werden.<br><br></li> Mehrer Suchbegriffe können mit einer Pipe "|" getrennt werden.<br><br></li>
<li><i>msg_format [ road | head | both ]</i> (Nur Verkehrsinfo.de)<br> <li><i>msg_format [ road | head | both ]</i> (Nur Verkehrsinfo.de)<br>
Über diesen Parameter kann die Meldung formatiert werden nach Strasse, Richtung oder beides<br><br></li> Über diesen Parameter kann die Meldung formatiert werden nach Strasse, Richtung oder beides<br><br></li>
<li><i><a href="#readingFnAttributes">readingFnAttributes</a></i><br><br></li>
</ul> </ul>
</ul> </ul>
<br> <br>