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 68b0dd9bef
commit f997060c5a

View File

@@ -17,7 +17,7 @@ eval "use Date::Parse;1" or $missingModule .= "Date::Parse ";
#######################
# Global variables
my $version = "1.2.0.6";
my $version = "1.2.0.7";
my $srandUsed;
@@ -158,7 +158,6 @@ sub todoist_Define($$) {
$hash->{NOTIFYDEV}= "global";
## start polling
if ($init_done) {
## at first, we delete old readings. List could have changed
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 "-");
## remove timers
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;
}