2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-04 05:16:45 +00:00

98_todoist: start polling after restart

git-svn-id: https://svn.fhem.de/fhem/trunk@18458 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
marvin78 2019-01-30 14:54:04 +00:00
parent b8cf6358fe
commit c69701b379

View File

@ -17,7 +17,7 @@ eval "use Date::Parse;1" or $missingModule .= "Date::Parse ";
####################### #######################
# Global variables # Global variables
my $version = "1.2.0.6"; my $version = "1.2.0.7";
my $srandUsed; my $srandUsed;
@ -158,7 +158,6 @@ sub todoist_Define($$) {
$hash->{NOTIFYDEV}= "global"; $hash->{NOTIFYDEV}= "global";
## start polling
if ($init_done) { if ($init_done) {
## at first, we delete old readings. List could have changed ## at first, we delete old readings. List could have changed
CommandDeleteReading(undef, "$hash->{NAME} (T|t)ask_.*"); CommandDeleteReading(undef, "$hash->{NAME} (T|t)ask_.*");
@ -168,9 +167,11 @@ sub todoist_Define($$) {
readingsSingleUpdate($hash,"state","inactive",1) if ($hash->{helper}{PWD_NEEDED} || ReadingsVal($name,"state","-") eq "-"); readingsSingleUpdate($hash,"state","inactive",1) if ($hash->{helper}{PWD_NEEDED} || ReadingsVal($name,"state","-") eq "-");
## remove timers ## remove timers
RemoveInternalTimer($hash,"todoist_GetTasks"); RemoveInternalTimer($hash,"todoist_GetTasks");
todoist_GetTasks($hash) if (!IsDisabled($name) && !$hash->{helper}{PWD_NEEDED});
} }
## start polling
todoist_GetTasks($hash) if (!IsDisabled($name) && !$hash->{helper}{PWD_NEEDED});
return undef; return undef;
} }