pnbruckner / ha-sun2

Home Assistant Sun2 Sensor
The Unlicense
236 stars 22 forks source link

Breaking change in HA2024.x #104

Closed FozzieUK closed 11 months ago

FozzieUK commented 11 months ago

Just a heads up, i'm running a dev version of the latest HA (2024.1.0.dev20231218) and there is a change to the way that HA handles metaclasses (I think this PR https://github.com/home-assistant/core/pull/105512), it has broken a few of my integrations , this one included, i'm working through them but the logs from Sun2 at startup are -

2023-12-24 09:47:40.823 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up sun2 platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/sun2/sensor.py", line 1299, in async_setup_platform
_sensors(
File "/config/custom_components/sun2/sensor.py", line 1235, in _sensors
_SENSOR_TYPES[config].cls(
File "/config/custom_components/sun2/sensor.py", line 391, in __init__
super().__init__(loc_params, extra, entity_description, "civil", name)
File "/config/custom_components/sun2/sensor.py", line 202, in __init__
entity_description.name = name
^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 4, in __setattr__
dataclasses.FrozenInstanceError: cannot assign to field 'name'
pnbruckner commented 11 months ago

Yep, saw that, have a fix, just haven't had time to release it. Hopefully today or tomorrow. Thanks!

FozzieUK commented 11 months ago

that's great, happy to test it as soon as it's released, many thanks 👍