Skip to content

Commit b892cc1

Browse files
authored
Revert "Remove Shelly redundant device entry check for sleepy devices" (home-assistant#158108)
1 parent 3046c7a commit b892cc1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

homeassistant/components/shelly/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ async def _async_setup_block_entry(
170170
device_entry = dev_reg.async_get_device(
171171
connections={(CONNECTION_NETWORK_MAC, dr.format_mac(entry.unique_id))},
172172
)
173+
# https://github.com/home-assistant/core/pull/48076
174+
if device_entry and entry.entry_id not in device_entry.config_entries:
175+
device_entry = None
173176

174177
sleep_period = entry.data.get(CONF_SLEEP_PERIOD)
175178
runtime_data = entry.runtime_data
@@ -280,6 +283,9 @@ async def _async_setup_rpc_entry(hass: HomeAssistant, entry: ShellyConfigEntry)
280283
device_entry = dev_reg.async_get_device(
281284
connections={(CONNECTION_NETWORK_MAC, dr.format_mac(entry.unique_id))},
282285
)
286+
# https://github.com/home-assistant/core/pull/48076
287+
if device_entry and entry.entry_id not in device_entry.config_entries:
288+
device_entry = None
283289

284290
sleep_period = entry.data.get(CONF_SLEEP_PERIOD)
285291
runtime_data = entry.runtime_data

0 commit comments

Comments
 (0)