55_weco.pm - code improvement

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@5517 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen
2014-04-13 00:37:45 +00:00
parent ec4629abc6
commit b44298b7f8

View File

@@ -115,11 +115,12 @@ sub weco_send($) {
Log3 ($name, 4, "weco $name server response: $response"); Log3 ($name, 4, "weco $name server response: $response");
readingsBulkUpdate($hash, "state", "active"); readingsBulkUpdate($hash, "state", "active");
} else { } else {
CommandDeleteReading(undef, "$name data");
CommandDeleteReading(undef, "$name response");
Log3 ($name, 4, "weco $name no data"); Log3 ($name, 4, "weco $name no data");
readingsBulkUpdate($hash, "state", "defined"); readingsBulkUpdate($hash, "state", "defined");
$attr{$name}{wecoInterval} = 60; $attr{$name}{wecoInterval} = 60;
} }
readingsEndUpdate($hash, 1); readingsEndUpdate($hash, 1);
InternalTimer(gettimeofday()+$attr{$name}{wecoInterval}, "weco_send", $hash, 0) unless($local == 1); InternalTimer(gettimeofday()+$attr{$name}{wecoInterval}, "weco_send", $hash, 0) unless($local == 1);