mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-12 16:46:35 +00:00
31_HUEDevice.pm: allow toggle command for unreachable devices, added ignoreReachable attribute
git-svn-id: https://svn.fhem.de/fhem/trunk@11704 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a0f3d35ffd
commit
cf61649154
@ -1,5 +1,7 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- changed: 31_HUEDevice: allow toggle command for unreachble devices
|
||||||
|
new ignoreReachable attribute
|
||||||
- update: 77_UWZ: New Minor Release 1.2 Support for United Kingdom
|
- update: 77_UWZ: New Minor Release 1.2 Support for United Kingdom
|
||||||
- feature: 74_AMAD: add Conditionsupport for older Androisversions
|
- feature: 74_AMAD: add Conditionsupport for older Androisversions
|
||||||
(Kreidezeit)
|
(Kreidezeit)
|
||||||
|
@ -128,7 +128,8 @@ sub HUEDevice_Initialize($)
|
|||||||
$hash->{GetFn} = "HUEDevice_Get";
|
$hash->{GetFn} = "HUEDevice_Get";
|
||||||
$hash->{AttrList} = "IODev ".
|
$hash->{AttrList} = "IODev ".
|
||||||
"delayedUpdate:1 ".
|
"delayedUpdate:1 ".
|
||||||
"realtimePicker:1 ".
|
"ignoreReachable:1,0 ".
|
||||||
|
"realtimePicker:1,0 ".
|
||||||
"color-icons:1,2 ".
|
"color-icons:1,2 ".
|
||||||
"transitiontime ".
|
"transitiontime ".
|
||||||
"model:".join(",", sort map { $_ =~ s/ /#/g ;$_} keys %hueModels)." ".
|
"model:".join(",", sort map { $_ =~ s/ /#/g ;$_} keys %hueModels)." ".
|
||||||
@ -158,7 +159,7 @@ HUEDevice_devStateIcon($)
|
|||||||
|
|
||||||
return undef if( $hash->{helper}->{devtype} );
|
return undef if( $hash->{helper}->{devtype} );
|
||||||
|
|
||||||
return ".*:light_question" if( !$hash->{helper}{reachable} );
|
return ".*:light_question:toggle" if( !$hash->{helper}{reachable} );
|
||||||
|
|
||||||
return ".*:off:toggle" if( ReadingsVal($name,"state","off") eq "off" );
|
return ".*:off:toggle" if( ReadingsVal($name,"state","off") eq "off" );
|
||||||
|
|
||||||
@ -327,7 +328,7 @@ HUEDevice_SetParam($$@)
|
|||||||
$value = int(1000000/$value);
|
$value = int(1000000/$value);
|
||||||
$cmd = 'ct';
|
$cmd = 'ct';
|
||||||
} elsif( $name && $cmd eq "toggle" ) {
|
} elsif( $name && $cmd eq "toggle" ) {
|
||||||
$cmd = ReadingsVal($name,"state","on") eq "off" ? "on" :"off";
|
$cmd = ReadingsVal($name,"onoff",1) ? "off" :"on";
|
||||||
} elsif( $cmd =~ m/^dim(\d+)/ ) {
|
} elsif( $cmd =~ m/^dim(\d+)/ ) {
|
||||||
$value2 = $value;
|
$value2 = $value;
|
||||||
$value = $1;
|
$value = $1;
|
||||||
@ -1116,6 +1117,7 @@ HUEDevice_Parse($$)
|
|||||||
$on = $hash->{helper}{on} if( !defined($on) );
|
$on = $hash->{helper}{on} if( !defined($on) );
|
||||||
my $reachable = $state->{reachable}?1:0;
|
my $reachable = $state->{reachable}?1:0;
|
||||||
$reachable = $hash->{helper}{reachable} if( !defined($state->{reachable}) );
|
$reachable = $hash->{helper}{reachable} if( !defined($state->{reachable}) );
|
||||||
|
$reachable = 1 if( $reachable == 0 && AttrVal($name, 'ignoreReachable', 0) );
|
||||||
my $colormode = $state->{'colormode'};
|
my $colormode = $state->{'colormode'};
|
||||||
my $bri = $state->{'bri'};
|
my $bri = $state->{'bri'};
|
||||||
$bri = $hash->{helper}{bri} if( !defined($bri) );
|
$bri = $hash->{helper}{bri} if( !defined($bri) );
|
||||||
@ -1349,6 +1351,8 @@ HUEDevice_Parse($$)
|
|||||||
<li>color-icon<br>
|
<li>color-icon<br>
|
||||||
1 -> use lamp color as icon color and 100% shape as icon shape<br>
|
1 -> use lamp color as icon color and 100% shape as icon shape<br>
|
||||||
2 -> use lamp color scaled to full brightness as icon color and dim state as icon shape</li>
|
2 -> use lamp color scaled to full brightness as icon color and dim state as icon shape</li>
|
||||||
|
<li>ignoreReachable<br>
|
||||||
|
ignore the reachable state that is reported by the hue bridge. assume the device is allways reachable.</li>
|
||||||
<li>subType<br>
|
<li>subType<br>
|
||||||
extcolordimmer -> device has rgb and color temperatur control<br>
|
extcolordimmer -> device has rgb and color temperatur control<br>
|
||||||
colordimmer -> device has rgb controll<br>
|
colordimmer -> device has rgb controll<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user