mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 04:35:11 +02: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:
@@ -221,7 +221,7 @@ class MetOfficeCurrentSensor(CoordinatorEntity, SensorEntity):
|
||||
elif hasattr(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
|
||||
|
||||
return value
|
||||
|
Reference in New Issue
Block a user