new readings batteryState and batteryPercent, readings battery and batteryLevel a deprecated and will be remove in future
This commit is contained in:
parent
eada585aab
commit
655646598f
@ -170,6 +170,7 @@ sub XiaomiBTLESens_Define($$) {
|
|||||||
CommandAttr(undef,$name . ' room XiaomiBTLESens') if( AttrVal($name,'room','none') eq 'none' );
|
CommandAttr(undef,$name . ' room XiaomiBTLESens') if( AttrVal($name,'room','none') eq 'none' );
|
||||||
|
|
||||||
Log3 $name, 3, "XiaomiBTLESens ($name) - defined with BTMAC $hash->{BTMAC}";
|
Log3 $name, 3, "XiaomiBTLESens ($name) - defined with BTMAC $hash->{BTMAC}";
|
||||||
|
Log3 $name, 1, "XiaomiBTLESens ($name) - readings battery and batteryLevel a deprecated and will be remove in future";
|
||||||
|
|
||||||
$modules{XiaomiBTLESens}{defptr}{$hash->{BTMAC}} = $hash;
|
$modules{XiaomiBTLESens}{defptr}{$hash->{BTMAC}} = $hash;
|
||||||
return undef;
|
return undef;
|
||||||
@ -657,6 +658,10 @@ sub XiaomiBTLESens_FlowerSensHandle0x38($$) {
|
|||||||
|
|
||||||
$readings{'batteryLevel'} = hex("0x".$dataBatFw[0]);
|
$readings{'batteryLevel'} = hex("0x".$dataBatFw[0]);
|
||||||
$readings{'battery'} = (hex("0x".$dataBatFw[0]) > 15 ? "ok" : "low");
|
$readings{'battery'} = (hex("0x".$dataBatFw[0]) > 15 ? "ok" : "low");
|
||||||
|
### neue Vereinheitlichung für Batteriereadings Forum #800017
|
||||||
|
$readings{'batteryPercent'} = hex("0x".$dataBatFw[0]);
|
||||||
|
$readings{'batteryState'} = (hex("0x".$dataBatFw[0]) > 15 ? "ok" : "low");
|
||||||
|
|
||||||
$readings{'firmware'} = ($dataBatFw[2]-30).".".($dataBatFw[4]-30).".".($dataBatFw[6]-30);
|
$readings{'firmware'} = ($dataBatFw[2]-30).".".($dataBatFw[4]-30).".".($dataBatFw[6]-30);
|
||||||
|
|
||||||
$hash->{helper}{CallBattery} = 1;
|
$hash->{helper}{CallBattery} = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user