-
- Downloads
Fix unique identifiers where multiple IKEA Tradfri gateways are in use (#136060)
* Create unique identifiers where multiple gateways are in use Resolving issue https://github.com/home-assistant/core/issues/134497 * Added migration function to __init__.py Added migration function to execute upon initialisation, to: a) remove the erroneously-added config)_entry added to the device (gateway B gets added as a config_entry to a device associated to gateway A), and b) swap out the non-unique identifiers for genuinely unique identifiers. * Added tests to simulate migration from bad data scenario (i.e. explicitly executing migrate_entity_unique_ids() from __init__.py) * Ammendments suggested in first review * Changes after second review * Rewrite of test_migrate_config_entry_and_identifiers after feedback * Converted migrate function into major version, updated tests * Finalised variable naming convention per feedback, added test to validate config entry migrated to v2 * Hopefully final changes for cosmetic / comment stucture * Further code-coverage in test_migrate_config_entry_and_identifiers() * Minor test corrections * Added test for non-tradfri identifiers
Showing
- homeassistant/components/tradfri/__init__.py 92 additions, 2 deletionshomeassistant/components/tradfri/__init__.py
- homeassistant/components/tradfri/config_flow.py 1 addition, 1 deletionhomeassistant/components/tradfri/config_flow.py
- homeassistant/components/tradfri/entity.py 1 addition, 1 deletionhomeassistant/components/tradfri/entity.py
- tests/components/tradfri/__init__.py 2 additions, 0 deletionstests/components/tradfri/__init__.py
- tests/components/tradfri/test_init.py 184 additions, 2 deletionstests/components/tradfri/test_init.py
Please register or sign in to comment