mirror of
https://github.com/home-assistant/core.git
synced 2025-11-17 15:00:12 +00:00
Fix error with pipeline device removal due to multiple selects (#152560)
This commit is contained in:
@@ -109,7 +109,7 @@ class AssistPipelineSelect(SelectEntity, restore_state.RestoreEntity):
|
|||||||
)
|
)
|
||||||
|
|
||||||
state = await self.async_get_last_state()
|
state = await self.async_get_last_state()
|
||||||
if state is not None and state.state in self.options:
|
if (state is not None) and (state.state in self.options):
|
||||||
self._attr_current_option = state.state
|
self._attr_current_option = state.state
|
||||||
|
|
||||||
if self.registry_entry and (device_id := self.registry_entry.device_id):
|
if self.registry_entry and (device_id := self.registry_entry.device_id):
|
||||||
@@ -119,7 +119,7 @@ class AssistPipelineSelect(SelectEntity, restore_state.RestoreEntity):
|
|||||||
|
|
||||||
def cleanup() -> None:
|
def cleanup() -> None:
|
||||||
"""Clean up registered device."""
|
"""Clean up registered device."""
|
||||||
pipeline_data.pipeline_devices.pop(device_id)
|
pipeline_data.pipeline_devices.pop(device_id, None)
|
||||||
|
|
||||||
self.async_on_remove(cleanup)
|
self.async_on_remove(cleanup)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user