Fix regression in zwave_js (#69312)

* Handle unique ID update during discovery step

* Use callback to convert unique IDs to strings

* Adjust test to make sure logic works

* Fix other tests

* Move comment

* Move migration to async_setup

* Remove async_migrate_entry since we take care of it during setup

* Remove unused test
This commit is contained in:
Raman Gupta 2022-04-06 00:40:33 -04:00 committed by GitHub
parent add01d434e
commit 79dc551f5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 33 deletions

View file

@ -8,7 +8,6 @@ from zwave_js_server.exceptions import BaseZwaveJSServerError, InvalidServerVers
from zwave_js_server.model.node import Node
from homeassistant.components.hassio.handler import HassioAPIError
from homeassistant.components.zwave_js import async_migrate_entry
from homeassistant.components.zwave_js.const import DOMAIN
from homeassistant.components.zwave_js.helpers import get_device_id
from homeassistant.config_entries import ConfigEntryDisabler, ConfigEntryState
@ -1328,12 +1327,3 @@ async def test_disabled_entity_on_value_removed(hass, zp3111, client, integratio
| {battery_level_entity, binary_cover_entity, sensor_cover_entity}
== new_unavailable_entities
)
async def test_async_migrate_entry(hass):
"""Test async_migrate_entry."""
entry = MockConfigEntry(domain=DOMAIN, unique_id=123456789)
assert isinstance(entry.unique_id, int)
await async_migrate_entry(hass, entry)
assert isinstance(entry.unique_id, str)
assert entry.unique_id == "123456789"