mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
98_Hyperion: devStateIcon for disconnected and code cleanup
git-svn-id: https://svn.fhem.de/fhem/trunk@12310 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
dc62dd6389
commit
fec33610f1
@ -221,15 +221,6 @@ sub Hyperion_Read($)
|
|||||||
}
|
}
|
||||||
elsif ($result =~ /^\{"info":\{.+\},"success":true\}$/)
|
elsif ($result =~ /^\{"info":\{.+\},"success":true\}$/)
|
||||||
{
|
{
|
||||||
######################
|
|
||||||
if (defined ReadingsVal($name,"previous_mode",undef))
|
|
||||||
{
|
|
||||||
# set new reading to former value
|
|
||||||
fhem "setreading $name mode_before_off ".ReadingsVal($name,"previous_mode","");
|
|
||||||
# delete old reading
|
|
||||||
fhem "deletereading $name previous_mode";
|
|
||||||
}
|
|
||||||
######################
|
|
||||||
my $obj = eval {from_json($result)};
|
my $obj = eval {from_json($result)};
|
||||||
my $data = $obj->{info};
|
my $data = $obj->{info};
|
||||||
if (AttrVal($name,"hyperionVersionCheck",1) == 1)
|
if (AttrVal($name,"hyperionVersionCheck",1) == 1)
|
||||||
@ -865,7 +856,6 @@ sub Hyperion_Call($;$)
|
|||||||
return undef if (IsDisabled($name) > 0);
|
return undef if (IsDisabled($name) > 0);
|
||||||
if (!$hash->{FD})
|
if (!$hash->{FD})
|
||||||
{
|
{
|
||||||
# DevIo_CloseDev($hash);
|
|
||||||
Hyperion_OpenDev($hash);
|
Hyperion_OpenDev($hash);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
@ -885,7 +875,7 @@ sub Hyperion_devStateIcon($;$)
|
|||||||
return ".*:off:toggle"
|
return ".*:off:toggle"
|
||||||
if (Value($name) eq "off");
|
if (Value($name) eq "off");
|
||||||
return ".*:light_exclamation"
|
return ".*:light_exclamation"
|
||||||
if (Value($name) eq "ERROR");
|
if (Value($name) =~ /^(ERROR|disconnected)$/);
|
||||||
return ".*:light_question"
|
return ".*:light_question"
|
||||||
if (Value($name) eq "Initialized");
|
if (Value($name) eq "Initialized");
|
||||||
return ".*:light_light_dim_$ico@#".$rgb.":toggle"
|
return ".*:light_light_dim_$ico@#".$rgb.":toggle"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user