Merge pull request #3 from LarveyOfficial/main

Fixed issue with Consumables on vacuums without consumables
This commit is contained in:
Luis Vervaet 2023-08-14 23:07:01 -04:00 committed by GitHub
commit ada4b58467
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_auto_return = self.tuyastatus.get(TUYA_CODES.AUTO_RETURN)
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:
self._attr_consumables = ast.literal_eval(
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.map_data = self.tuyastatus.get("121")
# self.erro_msg? = self.tuyastatus.get("124")
if self.robovac_supported & RoboVacEntityFeature.CONSUMABLES:
if self.tuyastatus.get(TUYA_CODES.X_CONSUMABLES) is not None:
self._attr_consumables = ast.literal_eval(
base64.b64decode(self.tuyastatus.get(TUYA_CODES.X_CONSUMABLES)).decode(