liangleslie / nea_sg_weather

Home Assistant integration for NEA Weather forecasts
MIT License
27 stars 8 forks source link

weather updates errors #22

Open MoonshineSG opened 11 months ago

MoonshineSG commented 11 months ago

errors on the last vest version…l

2023-12-12 08:34:49.863 ERROR (MainThread) [homeassistant.components.weather] Error while setting up nea_sg_weather platform for weather
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 369, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 509, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 754, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1025, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 745, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 845, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 788, in _async_generate_attributes
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 658, in state_attributes
    if (temperature := self.native_temperature) is not None:
                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nea_sg_weather/weather.py", line 108, in native_temperature
    return round(self.coordinator.data.temperature.temp_avg, 2)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: type str doesn't define __round__ method