Attempting to fix consumable issue

This commit is contained in:
Luis Vervaet 2023-08-14 23:04:54 -04:00 committed by GitHub
parent 9e523626a6
commit 5644f8cc33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 12 deletions

View File

@ -284,6 +284,7 @@ class RoboVacEntity(StateVacuumEntity):
self._attr_cleaning_time = self.tuyastatus.get(TUYA_CODES.CLEANING_TIME) self._attr_cleaning_time = self.tuyastatus.get(TUYA_CODES.CLEANING_TIME)
self._attr_auto_return = self.tuyastatus.get(TUYA_CODES.AUTO_RETURN) self._attr_auto_return = self.tuyastatus.get(TUYA_CODES.AUTO_RETURN)
self._attr_do_not_disturb = self.tuyastatus.get(TUYA_CODES.DO_NOT_DISTURB) self._attr_do_not_disturb = self.tuyastatus.get(TUYA_CODES.DO_NOT_DISTURB)
if self.robovac_supported & RoboVacEntityFeature.CONSUMABLES:
if self.tuyastatus.get(TUYA_CODES.G_CONSUMABLES) is not None: if self.tuyastatus.get(TUYA_CODES.G_CONSUMABLES) is not None:
self._attr_consumables = ast.literal_eval( self._attr_consumables = ast.literal_eval(
base64.b64decode(self.tuyastatus.get(TUYA_CODES.G_CONSUMABLES)).decode( base64.b64decode(self.tuyastatus.get(TUYA_CODES.G_CONSUMABLES)).decode(
@ -294,6 +295,7 @@ class RoboVacEntity(StateVacuumEntity):
self._attr_boost_iq = self.tuyastatus.get(TUYA_CODES.BOOST_IQ) self._attr_boost_iq = self.tuyastatus.get(TUYA_CODES.BOOST_IQ)
# self.map_data = self.tuyastatus.get("121") # self.map_data = self.tuyastatus.get("121")
# self.erro_msg? = self.tuyastatus.get("124") # self.erro_msg? = self.tuyastatus.get("124")
if self.robovac_supported & RoboVacEntityFeature.CONSUMABLES:
if self.tuyastatus.get(TUYA_CODES.X_CONSUMABLES) is not None: if self.tuyastatus.get(TUYA_CODES.X_CONSUMABLES) is not None:
self._attr_consumables = ast.literal_eval( self._attr_consumables = ast.literal_eval(
base64.b64decode(self.tuyastatus.get(TUYA_CODES.X_CONSUMABLES)).decode( base64.b64decode(self.tuyastatus.get(TUYA_CODES.X_CONSUMABLES)).decode(