fixes battery setting when device is not available (#2890)
* device: fix battery setting when device is not available
This commit is contained in:
parent
694513832d
commit
bebadc219c
|
|
@ -397,8 +397,8 @@ class Device:
|
||||||
self.persister["_battery"] = feature.value
|
self.persister["_battery"] = feature.value
|
||||||
return battery
|
return battery
|
||||||
except Exception:
|
except Exception:
|
||||||
if self.persister and battery_feature is None:
|
if self.persister and battery_feature is None and result is not None:
|
||||||
self.persister["_battery"] = result
|
self.persister["_battery"] = result.value
|
||||||
|
|
||||||
def set_battery_info(self, info):
|
def set_battery_info(self, info):
|
||||||
"""Update battery information for device, calling changed callback if necessary"""
|
"""Update battery information for device, calling changed callback if necessary"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue