Merge pull request #3 from LarveyOfficial/main
Fixed issue with Consumables on vacuums without consumables
This commit is contained in:
commit
ada4b58467
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue