mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 18:27:51 +00:00
Logs from issue #53031 show that not only ints are appearing in the values for the forecast data now, so change the check from just for int, to see whether the value has a "value" attribute before dereferencing it.
This commit is contained in:
parent
c9c1c62d67
commit
74023fce21
@ -221,7 +221,7 @@ class MetOfficeCurrentSensor(CoordinatorEntity, SensorEntity):
|
|||||||
elif hasattr(self.coordinator.data.now, self._type):
|
elif hasattr(self.coordinator.data.now, self._type):
|
||||||
value = getattr(self.coordinator.data.now, self._type)
|
value = getattr(self.coordinator.data.now, self._type)
|
||||||
|
|
||||||
if not isinstance(value, int):
|
if hasattr(value, "value"):
|
||||||
value = value.value
|
value = value.value
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user