From 2cc1cef65691112e64cab1f6ed4d8bd4af908041 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 9 Jan 2018 20:19:07 +0100 Subject: [PATCH] fix sensor read without firmware reading --- 74_XiaomiBTLESens.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/74_XiaomiBTLESens.pm b/74_XiaomiBTLESens.pm index b738e0f..c756ca5 100755 --- a/74_XiaomiBTLESens.pm +++ b/74_XiaomiBTLESens.pm @@ -47,7 +47,7 @@ use JSON; use Blocking; -my $version = "1.99.16"; +my $version = "1.99.21"; @@ -279,7 +279,7 @@ sub XiaomiBTLESens_stateRequest($) { readingsSingleUpdate($hash,"state","set attribute model first",1); } elsif( !IsDisabled($name) ) { - if( ReadingsVal($name,'firmware','none') ne 'none') { + if( ReadingsVal($name,'firmware','none') ne 'none' or AttrVal($name,'model','none') eq 'thermoHygroSens') { return XiaomiBTLESens_CallBatteryFirmware($hash) if( XiaomiBTLESens_CallBatteryFirmware_IsUpdateTimeAgeToOld($hash,$CallBatteryFirmwareAge{AttrVal($name,'BatteryFirmwareAge','24h')}) );