device: correctly handle missing battery feature

This commit is contained in:
Peter F. Patel-Schneider 2025-10-22 05:07:42 -04:00
parent 15ee0662f1
commit ab517577b5
1 changed files with 1 additions and 1 deletions

View File

@ -397,7 +397,7 @@ class Device:
self.persister["_battery"] = feature.value
return battery
except Exception:
if self.persister and battery_feature is None and result is not None:
if self.persister and battery_feature is None and result is not None and result != 0:
self.persister["_battery"] = result.value
def set_battery_info(self, info):