2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 07:56:03 +00:00

show software update notification

git-svn-id: https://svn.fhem.de/fhem/trunk@3138 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2013-04-30 10:16:10 +00:00
parent 63a7879f97
commit 5384865342

View File

@ -101,9 +101,6 @@ sub HUEBridge_OpenDev($)
return undef;
}
$hash->{name} = $result->{'name'};
$hash->{swversion} = $result->{'swversion'};
if( !defined($result->{'mac'}) )
{
HUEBridge_Pair($hash);
@ -181,15 +178,24 @@ sub
HUEBridge_GetUpdate($)
{
my ($hash) = @_;
my $name = $hash->{NAME};
if(!$hash->{LOCAL}) {
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "HUEBridge_GetUpdate", $hash, 1);
}
my $text='';
my $result = HUEBridge_Call($hash, 'config', undef);
$hash->{name} = $result->{name};
$hash->{swversion} = $result->{swversion};
return($text);
if( defined( $result->{swupdate} ) ) {
my $txt = $result->{swupdate}->{text};
readingsSingleUpdate($hash, "swupdate", $txt, defined($hash->{LOCAL} ? 0 : 1)) if( $txt ne ReadingsVal($name,"swupdate","") );
$hash->{updatestate} = $result->{swupdate}->{updatestate};
} elsif ( defined( $hash->{swupdate} ) ) {
delete( $hash->{updatestate} );
}
}
sub