fix: re-add consumables code
This commit is contained in:
parent
6cf2274e50
commit
6843472474
|
|
@ -357,11 +357,16 @@ 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["consumable"]
|
||||||
|
):
|
||||||
|
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