Fix the missing error key
This commit is contained in:
parent
19aefa8e65
commit
8e6e311bfc
|
|
@ -359,11 +359,13 @@ class RoboVacEntity(StateVacuumEntity):
|
||||||
CONSUMABLE_CODE in self.tuyastatus
|
CONSUMABLE_CODE in self.tuyastatus
|
||||||
and self.tuyastatus.get(CONSUMABLE_CODE) is not None
|
and self.tuyastatus.get(CONSUMABLE_CODE) is not None
|
||||||
):
|
):
|
||||||
self._attr_consumables = ast.literal_eval(
|
consumables = ast.literal_eval(
|
||||||
base64.b64decode(self.tuyastatus.get(CONSUMABLE_CODE)).decode(
|
base64.b64decode(self.tuyastatus.get(CONSUMABLE_CODE)).decode(
|
||||||
"ascii"
|
"ascii"
|
||||||
)
|
)
|
||||||
)["consumable"]["duration"]
|
)
|
||||||
|
if "consumable" in consumables and "duration" in consumables:
|
||||||
|
self._attr_consumables = consumables["consumable"]["duration"]
|
||||||
|
|
||||||
async def async_locate(self, **kwargs):
|
async def async_locate(self, **kwargs):
|
||||||
"""Locate the vacuum cleaner."""
|
"""Locate the vacuum cleaner."""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue