DurgNomis-drol / ha_toyota

Toyota Connected Services integration for Home Assistant.
MIT License
143 stars 27 forks source link

invalid suggested_unit_of_measurement #250

Open desosav opened 5 months ago

desosav commented 5 months ago

Logger: homeassistant.components.sensor Source: components/sensor/init.py:394 integration: Sensor (documentation, issues)

<class 'custom_components.toyota.sensor.ToyotaSensor'> sets an invalid suggested_unit_of_measurement. Please create a bug report at https://github.com/DurgNomis-drol/ha_toyota/issues. This warning will become an error in Home Assistant Core 2024.5

CM000n commented 5 months ago

Thanks for reporting. Will have an look into it

wolfspirituk commented 1 month ago

Did anything get found - any hope of resolving this - I have the same.

2024-07-29 08:26:45.583 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up toyota.binary_sensor 2024-07-29 08:26:45.584 INFO (MainThread) [homeassistant.components.device_tracker] Setting up toyota.device_tracker 2024-07-29 08:26:45.585 INFO (MainThread) [homeassistant.components.sensor] Setting up toyota.sensor 2024-07-29 08:26:45.590 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity None for domain sensor with platform toyota Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 598, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 831, in _async_add_entity unit_of_measurement=entity.unit_of_measurement, ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 512, in unit_of_measurement if self._is_valid_suggested_unit(suggested_unit_of_measurement): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 383, in _is_valid_suggested_unit raise ValueError( ValueError: Entity <class 'custom_components.toyota.sensor.ToyotaSensor'> suggest an incorrect unit of measurement: %.