jseidl / hass-magic_areas

Areas with batteries included for Home Assistant
MIT License
254 stars 28 forks source link

Bug: Magic Areas is using deprecated APIs and should migrate #331

Closed Mimoja closed 3 months ago

Mimoja commented 4 months ago

Describe the bug Home assistant complains during startup:

2024-05-12 21:32:41.113 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'magic_areas' accesses hass.helpers.entity_registry. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from entity_registry directly at custom_components/magic_areas/base/magic.py, line 203: entity_registry = self.hass.helpers.entity_registry.async_get(self.hass), please create a bug report at https://github.com/jseidl/hass-magic_areas/issues
2024-05-12 21:32:41.123 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'magic_areas' accesses hass.helpers.device_registry. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from device_registry directly at custom_components/magic_areas/base/magic.py, line 161: device_registry = self.hass.helpers.device_registry.async_get(self.hass), please create a bug report at https://github.com/jseidl/hass-magic_areas/issues
2024-05-12 21:32:41.171 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'magic_areas' calls `async_track_state_change` instead of `async_track_state_change_event` which is deprecated and will be removed in Home Assistant 2025.5 at custom_components/magic_areas/binary_sensor.py, line 211: async_track_state_change(self.hass, self.sensors, self.sensor_state_change), please create a bug report at https://github.com/jseidl/hass-magic_areas/issues

Expected behavior The integration is using an non-deprecated api

Desktop (please complete the following information):

Additional Context Deadlines are 2024.11 and 2025.5

jseidl commented 3 months ago

Fixed by #326