Steps to Reproduce
Configure the integration to include both level and index sensors. Confirm that an index is being reported as expected, but that level is "Unknown".
Expected behavior
Each configured area should have a sensor for the index (showing a number) and the level (describing the AQ).
Debug log
Logger: homeassistant.helpers.entity
Source: components/sensor/__init__.py:583
First occurred: 17:22:54 (6 occurrences)
Last logged: 17:22:54
Update for sensor.iaq_level_living_room fails
Update for sensor.iaq_level_kitchen fails
Update for sensor.iaq_level_richards_room fails
Update for sensor.iaq_level_kalis_room fails
Update for sensor.iaq_level_childrens_room fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 579, in state
numerical_value = int(value)
ValueError: invalid literal for int() with base 10: 'Good'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 554, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update
await coro
File "/config/custom_components/iaquk/sensor.py", line 102, in async_update
if self.state == LEVEL_EXCELLENT
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 583, in state
raise ValueError(
ValueError: Sensor sensor.iaq_level_office has device class None, state class measurement unit None and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: Good (<class 'str'>)
Environment
Describe the bug
The level sensors are all showing as Unknown. The index sensors all show data as expected.
Configuration.yaml
Steps to Reproduce Configure the integration to include both level and index sensors. Confirm that an index is being reported as expected, but that level is "Unknown".
Expected behavior
Each configured area should have a sensor for the index (showing a number) and the level (describing the AQ).
Debug log
Additional context N/A