diff --git a/homeassistant/components/onewire/__init__.py b/homeassistant/components/onewire/__init__.py index 4bf0382a92c..fbcc5a5fe04 100644 --- a/homeassistant/components/onewire/__init__.py +++ b/homeassistant/components/onewire/__init__.py @@ -23,7 +23,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry): except CannotConnect as exc: raise ConfigEntryNotReady() from exc - hass.data[DOMAIN][config_entry.unique_id] = onewirehub + hass.data[DOMAIN][config_entry.entry_id] = onewirehub async def cleanup_registry() -> None: # Get registries @@ -71,5 +71,5 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry): config_entry, PLATFORMS ) if unload_ok: - hass.data[DOMAIN].pop(config_entry.unique_id) + hass.data[DOMAIN].pop(config_entry.entry_id) return unload_ok diff --git a/homeassistant/components/onewire/binary_sensor.py b/homeassistant/components/onewire/binary_sensor.py index 86b584c998c..4e25ba431c3 100644 --- a/homeassistant/components/onewire/binary_sensor.py +++ b/homeassistant/components/onewire/binary_sensor.py @@ -81,7 +81,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): """Set up 1-Wire platform.""" # Only OWServer implementation works with binary sensors if config_entry.data[CONF_TYPE] == CONF_TYPE_OWSERVER: - onewirehub = hass.data[DOMAIN][config_entry.unique_id] + onewirehub = hass.data[DOMAIN][config_entry.entry_id] entities = await hass.async_add_executor_job(get_entities, onewirehub) async_add_entities(entities, True) diff --git a/homeassistant/components/onewire/sensor.py b/homeassistant/components/onewire/sensor.py index bc4dfc3dcf1..ef703c99c0f 100644 --- a/homeassistant/components/onewire/sensor.py +++ b/homeassistant/components/onewire/sensor.py @@ -250,7 +250,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= async def async_setup_entry(hass, config_entry, async_add_entities): """Set up 1-Wire platform.""" - onewirehub = hass.data[DOMAIN][config_entry.unique_id] + onewirehub = hass.data[DOMAIN][config_entry.entry_id] entities = await hass.async_add_executor_job( get_entities, onewirehub, config_entry.data ) diff --git a/homeassistant/components/onewire/switch.py b/homeassistant/components/onewire/switch.py index da1ed01a980..1753800fbf0 100644 --- a/homeassistant/components/onewire/switch.py +++ b/homeassistant/components/onewire/switch.py @@ -144,7 +144,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): """Set up 1-Wire platform.""" # Only OWServer implementation works with switches if config_entry.data[CONF_TYPE] == CONF_TYPE_OWSERVER: - onewirehub = hass.data[DOMAIN][config_entry.unique_id] + onewirehub = hass.data[DOMAIN][config_entry.entry_id] entities = await hass.async_add_executor_job(get_entities, onewirehub) async_add_entities(entities, True) diff --git a/tests/components/onewire/test_init.py b/tests/components/onewire/test_init.py index 4a3724c5dd0..c715adcc16b 100644 --- a/tests/components/onewire/test_init.py +++ b/tests/components/onewire/test_init.py @@ -35,7 +35,6 @@ async def test_owserver_connect_failure(hass): CONF_HOST: "1.2.3.4", CONF_PORT: "1234", }, - unique_id=f"{CONF_TYPE_OWSERVER}:1.2.3.4:1234", options={}, entry_id="2", ) @@ -63,7 +62,6 @@ async def test_failed_owserver_listing(hass): CONF_HOST: "1.2.3.4", CONF_PORT: "1234", }, - unique_id=f"{CONF_TYPE_OWSERVER}:1.2.3.4:1234", options={}, entry_id="2", )