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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue