mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
Added attribute for sending the timestamp to the pushover api.
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4583 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1bf0fc9667
commit
86055a67ba
@ -42,6 +42,7 @@ sub Pushover_Initialize($$)
|
|||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
$hash->{DefFn} = "Pushover_Define";
|
$hash->{DefFn} = "Pushover_Define";
|
||||||
$hash->{SetFn} = "Pushover_Set";
|
$hash->{SetFn} = "Pushover_Set";
|
||||||
|
$hash->{AttrList} = "timestamp:0,1";
|
||||||
}
|
}
|
||||||
|
|
||||||
sub Pushover_Define($$)
|
sub Pushover_Define($$)
|
||||||
@ -189,6 +190,13 @@ sub Pushover_Set_Message
|
|||||||
$body = $body . "&" . "expire=" . $expire;
|
$body = $body . "&" . "expire=" . $expire;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $timestamp = AttrVal($hash->{NAME}, "timestamp", 0);
|
||||||
|
|
||||||
|
if (1 == $timestamp)
|
||||||
|
{
|
||||||
|
$body = $body . "&" . "timestamp=" . time();
|
||||||
|
}
|
||||||
|
|
||||||
return Pushover_HTTP_Call($hash, $body);
|
return Pushover_HTTP_Call($hash, $body);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user