From 6cf2274e5001dbcb364f26ef4dcece6ac45eed4f Mon Sep 17 00:00:00 2001 From: Luke Morrigan Date: Fri, 22 Mar 2024 00:30:57 +0000 Subject: [PATCH] Revert "Fix the missing error key" This reverts commit 8e6e311bfcc771cb0766ecd6f913f9dcf300992a. --- custom_components/robovac/vacuum.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/custom_components/robovac/vacuum.py b/custom_components/robovac/vacuum.py index 0da7ba2..af87754 100644 --- a/custom_components/robovac/vacuum.py +++ b/custom_components/robovac/vacuum.py @@ -357,13 +357,11 @@ class RoboVacEntity(StateVacuumEntity): CONSUMABLE_CODE in self.tuyastatus and self.tuyastatus.get(CONSUMABLE_CODE) is not None ): - consumables = ast.literal_eval( + self._attr_consumables = ast.literal_eval( base64.b64decode(self.tuyastatus.get(CONSUMABLE_CODE)).decode( "ascii" ) - ) - if "consumable" in consumables and "duration" in consumables: - self._attr_consumables = consumables["consumable"]["duration"] + )["consumable"]["duration"] async def async_locate(self, **kwargs): """Locate the vacuum cleaner."""