Fix Shelly logbook exception when missing COAP (#47620)

This commit is contained in:
Shay Levy 2021-03-08 16:59:54 +02:00 committed by GitHub
parent 197687399d
commit 24db0ff956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,9 +177,9 @@ def get_device_wrapper(hass: HomeAssistant, device_id: str):
return None
for config_entry in hass.data[DOMAIN][DATA_CONFIG_ENTRY]:
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry][COAP]
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry].get(COAP)
if wrapper.device_id == device_id:
if wrapper and wrapper.device_id == device_id:
return wrapper
return None