leeyuentuen / polestar_api

Polestar Api - Home Assistant Component
MIT License
112 stars 18 forks source link

Error setting up platform in latest 1.2.4 #34

Closed fredrike closed 6 months ago

fredrike commented 6 months ago

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:361 Integration: Sensor (documentation, issues) First occurred: December 26, 2023 at 17:52:36 (2 occurrences) Last logged: 08:20:39

Error while setting up polestar_api 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/polestar_api/sensor.py", line 392, in async_setup_entry sensors = [ ^ File "/config/custom_components/polestar_api/sensor.py", line 393, in PolestarSensor(device, description) for description in POLESTAR_SENSOR_TYPES ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/polestar_api/sensor.py", line 416, in init self.translationkey = f"polestar{description.key}" ^^^^^^^^^^^^^^^^^^^^ AttributeError: property 'translation_key' of 'PolestarSensor' object has no setter

leeyuentuen commented 6 months ago

still exist in latest beta version 1.2.4? normally that self.translation_key is changed to self._attr_translation_key

https://github.com/leeyuentuen/polestar_api/blob/9a6799ac6987a1c07d7513b06885e2c2726cb30e/custom_components/polestar_api/sensor.py#L416

fredrike commented 6 months ago

I did a re-download and now it works thank you for the nice work!