86_Robonect.pm: ABU 20170427 fixed numerich undefs
git-svn-id: https://svn.fhem.de/fhem/trunk@14124 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
# ABU 20170301 fixed hybernate-check in set
|
# ABU 20170301 fixed hybernate-check in set
|
||||||
# ABU 20170406 fixed hybernate-check in timer
|
# ABU 20170406 fixed hybernate-check in timer
|
||||||
# ABU 20170422 fixed doku
|
# ABU 20170422 fixed doku
|
||||||
|
# ABU 20170427 fixed numerich undefs
|
||||||
|
|
||||||
package main;
|
package main;
|
||||||
|
|
||||||
@@ -562,7 +563,7 @@ sub Robonect_callback ($)
|
|||||||
readingsBulkUpdate($hash, $key, $value);
|
readingsBulkUpdate($hash, $key, $value);
|
||||||
$value = 0;
|
$value = 0;
|
||||||
($key, $value) = Robonect_decodeContent ($hash, $answer, "status", "duration", undef);
|
($key, $value) = Robonect_decodeContent ($hash, $answer, "status", "duration", undef);
|
||||||
readingsBulkUpdate($hash, $key, sprintf ("%d", $value/3600));
|
readingsBulkUpdate($hash, $key, sprintf ("%d", $value/3600)) if (defined($value) and ($value =~ m/(?:\d*\.)?\d+/));
|
||||||
($key, $value) = Robonect_decodeContent ($hash, $answer, "status", "hours", undef);
|
($key, $value) = Robonect_decodeContent ($hash, $answer, "status", "hours", undef);
|
||||||
readingsBulkUpdate($hash, $key, $value);
|
readingsBulkUpdate($hash, $key, $value);
|
||||||
|
|
||||||
@@ -578,7 +579,7 @@ sub Robonect_callback ($)
|
|||||||
($key, $value) = Robonect_decodeContent ($hash, $answer, "wlan", "signal", undef);
|
($key, $value) = Robonect_decodeContent ($hash, $answer, "wlan", "signal", undef);
|
||||||
readingsBulkUpdate($hash, $key, $value);
|
readingsBulkUpdate($hash, $key, $value);
|
||||||
|
|
||||||
if (defined($value))
|
if (defined($value) and ($value =~ m/(?:\d*\.)?\d+/))
|
||||||
{
|
{
|
||||||
$value = sprintf ("%d", ($value + 95) / 0.6);
|
$value = sprintf ("%d", ($value + 95) / 0.6);
|
||||||
readingsBulkUpdate($hash, $key . "-prozent", $value);
|
readingsBulkUpdate($hash, $key . "-prozent", $value);
|
||||||
|
|||||||
Reference in New Issue
Block a user