70_Pushover.pm: Now returning undef, if set was successful and timestamp is casted to integer.

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7252 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jbosecker
2014-12-18 12:51:22 +00:00
parent 33a3923391
commit a4824c8d94

View File

@@ -131,7 +131,7 @@ sub Pushover_HTTP_Call
{ {
if ($1 eq "1") if ($1 eq "1")
{ {
return "OK"; return undef;
} }
elsif ($response =~ m/"errors":\[(.*)\]/) elsif ($response =~ m/"errors":\[(.*)\]/)
{ {
@@ -144,7 +144,7 @@ sub Pushover_HTTP_Call
} }
else else
{ {
return "Error: No known response" return "Error: No known response\nResponse was: " . $response;
} }
} }
@@ -271,7 +271,7 @@ sub Pushover_Set_Message
if (1 == $timestamp) if (1 == $timestamp)
{ {
$body = $body . "&" . "timestamp=" . time(); $body = $body . "&" . "timestamp=" . int(time());
} }
my $result = Pushover_HTTP_Call($hash, $body, $ssl); my $result = Pushover_HTTP_Call($hash, $body, $ssl);