mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Handle KeyError when accessing device information (#52650)
This commit is contained in:
parent
cd7f366501
commit
351b67ffb1
@ -59,8 +59,8 @@ def setup(hass, config):
|
|||||||
for device in devices:
|
for device in devices:
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
"Discovered Ecovacs device on account: %s with nickname %s",
|
"Discovered Ecovacs device on account: %s with nickname %s",
|
||||||
device["did"],
|
device.get("did"),
|
||||||
device["nick"],
|
device.get("nick"),
|
||||||
)
|
)
|
||||||
vacbot = VacBot(
|
vacbot = VacBot(
|
||||||
ecovacs_api.uid,
|
ecovacs_api.uid,
|
||||||
@ -77,7 +77,8 @@ def setup(hass, config):
|
|||||||
"""Shut down open connections to Ecovacs XMPP server."""
|
"""Shut down open connections to Ecovacs XMPP server."""
|
||||||
for device in hass.data[ECOVACS_DEVICES]:
|
for device in hass.data[ECOVACS_DEVICES]:
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
"Shutting down connection to Ecovacs device %s", device.vacuum["did"]
|
"Shutting down connection to Ecovacs device %s",
|
||||||
|
device.vacuum.get("did"),
|
||||||
)
|
)
|
||||||
device.disconnect()
|
device.disconnect()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user