Skip to content

Starkvind - Sensors cannot be initialized because the integration is not following the latest standard API of HA #166

@jfhautenauven

Description

@jfhautenauven

After updating Home Assistant, the dirigera_platform custom component fails to set up the IKEA Starkvind air purifier sensors. The error occurs during platform setup and prevents the sensor entities from being created.

The error seems to come from a mismatched keyword argument in sensor.py (around line 112).
Home Assistant entity classes now use the property name native_unit_of_measurement instead of native_uom.

Suggested change:

In

/custom_components/dirigera_platform/sensor.py

Find this line:

native_uom="%",

Replace it with:

native_unit_of_measurement="%",

After this change, the component loads correctly and the sensors are created as expected.

Error log :

Enregistreur: homeassistant.components.sensor
Source: helpers/entity_platform.py:451
intégration: Capteur (documentation, problèmes)
S'est produit pour la première fois: 09:53:21 (1 occurrence)
Dernier enregistrement: 09:53:21

Error while setting up dirigera_platform platform for sensor: ikea_starkvind_air_purifier_sensor.init() got an unexpected keyword argument 'native_uom'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 451, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/dirigera_platform/sensor.py", line 67, in async_setup_entry
await add_air_purifier_sensors(async_add_entities, platform.air_purifiers)
File "/config/custom_components/dirigera_platform/sensor.py", line 112, in add_air_purifier_sensors
ikea_starkvind_air_purifier_sensor(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
device=air_purifier,
^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
icon_name="mdi:clock-time-eleven-outline",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
TypeError: ikea_starkvind_air_purifier_sensor.init() got an unexpected keyword argument 'native_uom'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions