palazzem / ha-econnect-alarm

Home Assistant integration that provides a full-fledged Alarm Panel to control your Elmo/IESS alarm systems.
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

Address deprecation warnings for Home Assistant `2024.3.0` #156

Closed palazzem closed 6 months ago

palazzem commented 6 months ago

Describe the bug After installing version 2024.3.0, there are multiple deprecation warnings and some tests fail.

That said, the integration works properly as these are only deprecation warnings.

Error message Deprecation warnings:

# Triggered by Migration V2
WARNING:homeassistant.helpers.frame:Detected code that sets "data" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead. Please report this issue.
WARNING:homeassistant.helpers.frame:Detected code that sets "options" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead. Please report this issue.
WARNING:homeassistant.helpers.frame:Detected that custom integration 'econnect_metronet' sets "version" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead at custom_components/econnect_metronet/__init__.py, line 57: config.version = 2, please report it to the author of the 'econnect_metronet' custom integration
WARNING  homeassistant.helpers.frame:frame.py:124 Detected code that sets "data" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead. Please report this issue.
WARNING  homeassistant.helpers.frame:frame.py:124 Detected code that sets "options" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead. Please report this issue.
WARNING  homeassistant.helpers.frame:frame.py:156 Detected that custom integration 'econnect_metronet' sets "version" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead at custom_components/econnect_metronet/__init__.py, line 57: config.version = 2, please report it to the author of the 'econnect_metronet' custom integration

# Triggered by Migration V3
WARNING:homeassistant.helpers.frame:Detected code that sets "data" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead. Please report this issue.
WARNING:homeassistant.helpers.frame:Detected code that sets "options" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead. Please report this issue.
WARNING:homeassistant.helpers.frame:Detected that custom integration 'econnect_metronet' sets "version" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead at custom_components/econnect_metronet/__init__.py, line 66: config.version = 3, please report it to the author of the 'econnect_metronet' custom integration
WARNING  homeassistant.helpers.frame:frame.py:124 Detected code that sets "data" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead. Please report this issue.
WARNING  homeassistant.helpers.frame:frame.py:124 Detected code that sets "options" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead. Please report this issue.
WARNING  homeassistant.helpers.frame:frame.py:156 Detected that custom integration 'econnect_metronet' sets "version" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead at custom_components/econnect_metronet/__init__.py, line 66: config.version = 3, please report it to the author of the 'econnect_metronet' custom integration

Tests failing:

FAILED tests/test_migrations.py::test_async_migrate_from_v1 - homeassistant.config_entries.UnknownEntry: test_entry_id
FAILED tests/test_migrations.py::test_async_migrate_from_v2 - homeassistant.config_entries.UnknownEntry: test_entry_id

Expected behavior No deprecation warning or failing tests.

Additional context This must be fixed before version 2024.9 otherwise the integration will stop working.

To Reproduce Run tests:

pytest tests --cov --cov-branch -vv

Environment