Check "status" is present before access during device update (#127091)

pull/127096/head
Simon Goodall 2024-09-30 11:06:48 +01:00 committed by GitHub
parent 0672e1a1ea
commit 5e64caa225
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -127,5 +127,5 @@ class HiveSensorEntity(HiveEntity, SensorEntity):
await self.hive.session.updateData(self.device)
self.device = await self.hive.sensor.getSensor(self.device)
self._attr_native_value = self.entity_description.fn(
self.device["status"]["state"]
self.device.get("status", {}).get("state")
)