Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid suggested_unit_of_measurement #250

Open
desosav opened this issue Mar 26, 2024 · 2 comments
Open

invalid suggested_unit_of_measurement #250

desosav opened this issue Mar 26, 2024 · 2 comments
Labels

Comments

@desosav
Copy link

desosav commented Mar 26, 2024

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
Copy link
Collaborator

CM000n commented Mar 28, 2024

Thanks for reporting. Will have an look into it

@wolfspirituk
Copy link

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: %.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants