mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
31_HUEDevice.pm: added readingList attribute
git-svn-id: https://svn.fhem.de/fhem/trunk@22900 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
8b81263208
commit
f34b8351ca
@ -1,5 +1,7 @@
|
||||
# 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.
|
||||
- feature: 31_HUEDevice: added gesture reading for Aqara Cube
|
||||
added readingList attribute
|
||||
- feature: 50_SSChatBot: new getter apiInfo
|
||||
- feature: 49_SSCam: new getter apiInfo
|
||||
- bugfix: 10_SOMFY: corrected autostore rolling code (esp. restart)
|
||||
|
@ -186,6 +186,7 @@ sub HUEDevice_Initialize($)
|
||||
"setList:textField-long ".
|
||||
"configList:textField-long ".
|
||||
"subType:extcolordimmer,colordimmer,ctdimmer,dimmer,switch,blind ".
|
||||
"readingList ".
|
||||
$readingFnAttributes;
|
||||
|
||||
#$hash->{FW_summaryFn} = "HUEDevice_summaryFn";
|
||||
@ -1621,6 +1622,12 @@ HUEDevice_Parse($$)
|
||||
|
||||
#Aqara Cube
|
||||
$readings{gesture} = $state->{gesture} if( defined($state->{gesture}) );
|
||||
|
||||
if( my $entries = $hash->{helper}{readingList} ) {
|
||||
foreach my $entry (@{$entries}) {
|
||||
$readings{$entry} = $state->{$entry} if( defined($state->{$entry}) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$hash->{lastupdated} = ReadingsVal( $name, '.lastupdated', '' ) if( !$hash->{lastupdated} );
|
||||
@ -1882,6 +1889,15 @@ HUEDevice_Attr($$$;$)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} elsif( $attrName eq 'readingList' ) {
|
||||
my $hash = $defs{$name};
|
||||
delete $hash->{helper}{$attrName};
|
||||
return "$name is not a sensor device" if( $hash->{helper}->{devtype} ne 'S' );
|
||||
if( $cmd eq "set" && $attrVal ) {
|
||||
my @a = split("[ ,]+", $attrVal);
|
||||
$hash->{helper}{$attrName} = \@a;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@ -2055,6 +2071,8 @@ absent:{<json>}</code></li>
|
||||
The list of know config commands for sensor type devices. one command per line, eg.: <code><br>
|
||||
attr mySensor mode:{<json>}\<br>
|
||||
/heatsetpoint (.*)/:perl:{'{"heatsetpoint":'. $VALUE1 * 100 .'}'}</code></li>
|
||||
<li>readingList<br>
|
||||
The list of readings that should be created from the sensor state object. Space or comma separated.</li>
|
||||
<li>subType<br>
|
||||
extcolordimmer -> device has rgb and color temperatur control<br>
|
||||
colordimmer -> device has rgb controll<br>
|
||||
|
Loading…
Reference in New Issue
Block a user