Skip to content

Commit 8acd1f4

Browse files
feat: force update on command, and switch to using start/pause command
1 parent 4bb8976 commit 8acd1f4

37 files changed

+58
-50
lines changed

custom_components/robovac/vacuum.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,34 +399,39 @@ async def async_locate(self, **kwargs):
399399
await self.vacuum.async_set({code: False})
400400
else:
401401
await self.vacuum.async_set({code: True})
402+
asyncio.create_task(self.async_forced_update())
402403

403404
async def async_return_to_base(self, **kwargs):
404405
"""Set the vacuum cleaner to return to the dock."""
405406
_LOGGER.info("Return home Pressed")
406407
await self.vacuum.async_set(
407408
{self._tuya_command_codes[RobovacCommand.RETURN_HOME]: True}
408409
)
410+
asyncio.create_task(self.async_forced_update())
409411

410412
async def async_start(self, **kwargs):
411-
self._attr_mode = "auto"
412413
await self.vacuum.async_set(
413-
{self._tuya_command_codes[RobovacCommand.MODE]: self.mode}
414+
{self._tuya_command_codes[RobovacCommand.START_PAUSE]: True}
414415
)
416+
asyncio.create_task(self.async_forced_update())
415417

416418
async def async_pause(self, **kwargs):
417419
await self.vacuum.async_set(
418-
{self._tuya_command_codes[RobovacCommand.PAUSE]: False}
420+
{self._tuya_command_codes[RobovacCommand.START_PAUSE]: False}
419421
)
422+
asyncio.create_task(self.async_forced_update())
420423

421424
async def async_stop(self, **kwargs):
422425
await self.async_return_to_base()
426+
asyncio.create_task(self.async_forced_update())
423427

424428
async def async_clean_spot(self, **kwargs):
425429
"""Perform a spot clean-up."""
426430
_LOGGER.info("Spot Clean Pressed")
427431
await self.vacuum.async_set(
428432
{self._tuya_command_codes[RobovacCommand.MODE]: "Spot"}
429433
)
434+
asyncio.create_task(self.async_forced_update())
430435

431436
async def async_set_fan_speed(self, fan_speed, **kwargs):
432437
"""Set fan speed."""
@@ -438,6 +443,7 @@ async def async_set_fan_speed(self, fan_speed, **kwargs):
438443
]
439444
}
440445
)
446+
asyncio.create_task(self.async_forced_update())
441447

442448
async def async_send_command(
443449
self, command: str, params: dict | list | None = None, **kwargs
@@ -480,6 +486,7 @@ async def async_send_command(
480486
base64_str = base64.b64encode(json_str.encode("utf8")).decode("utf8")
481487
_LOGGER.info("roomClean call %s", json_str)
482488
await self.vacuum.async_set({"124": base64_str})
489+
asyncio.create_task(self.async_forced_update())
483490

484491
async def async_will_remove_from_hass(self):
485492
await self.vacuum.async_disable()

custom_components/robovac/vacuums/T1250.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class T1250:
1717
)
1818
robovac_features = RoboVacEntityFeature.CLEANING_TIME | RoboVacEntityFeature.CLEANING_AREA | RoboVacEntityFeature.DO_NOT_DISTURB | RoboVacEntityFeature.AUTO_RETURN | RoboVacEntityFeature.CONSUMABLES
1919
commands = {
20-
RobovacCommand.PAUSE: 2,
20+
RobovacCommand.START_PAUSE: 2,
2121
RobovacCommand.DIRECTION: {
2222
"code": 3,
2323
"values": ["forward", "back", "left", "right"],

custom_components/robovac/vacuums/T2103.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class T2103:
1717
)
1818
robovac_features = RoboVacEntityFeature.EDGE | RoboVacEntityFeature.SMALL_ROOM
1919
commands = {
20-
RobovacCommand.PAUSE: 2,
20+
RobovacCommand.START_PAUSE: 2,
2121
RobovacCommand.DIRECTION: {
2222
"code": 3,
2323
"values": ["forward", "back", "left", "right"],
@@ -30,7 +30,7 @@ class T2103:
3030
RobovacCommand.RETURN_HOME: 101,
3131
RobovacCommand.FAN_SPEED: {
3232
"code": 102,
33-
"values": ["No_Suction","Standard","Boost_IQ","Max"],
33+
"values": ["No_suction","Standard","Boost_IQ","Max"],
3434
},
3535
RobovacCommand.LOCATE: 103,
3636
RobovacCommand.BATTERY: 104,

custom_components/robovac/vacuums/T2117.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class T2117:
1717
)
1818
robovac_features = RoboVacEntityFeature.EDGE | RoboVacEntityFeature.SMALL_ROOM
1919
commands = {
20-
RobovacCommand.PAUSE: 2,
20+
RobovacCommand.START_PAUSE: 2,
2121
RobovacCommand.DIRECTION: {
2222
"code": 3,
2323
"values": ["forward", "back", "left", "right"],
@@ -30,7 +30,7 @@ class T2117:
3030
RobovacCommand.RETURN_HOME: 101,
3131
RobovacCommand.FAN_SPEED: {
3232
"code": 102,
33-
"values": ["No_Suction","Standard","Boost_IQ","Max"],
33+
"values": ["No_suction","Standard","Boost_IQ","Max"],
3434
},
3535
RobovacCommand.LOCATE: 103,
3636
RobovacCommand.BATTERY: 104,

custom_components/robovac/vacuums/T2118.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class T2118:
1717
)
1818
robovac_features = RoboVacEntityFeature.EDGE | RoboVacEntityFeature.SMALL_ROOM
1919
commands = {
20-
RobovacCommand.PAUSE: 2,
20+
RobovacCommand.START_PAUSE: 2,
2121
RobovacCommand.DIRECTION: {
2222
"code": 3,
2323
"values": ["forward", "back", "left", "right"],
@@ -30,7 +30,7 @@ class T2118:
3030
RobovacCommand.RETURN_HOME: 101,
3131
RobovacCommand.FAN_SPEED: {
3232
"code": 102,
33-
"values": ["No_Suction","Standard","Boost_IQ","Max"],
33+
"values": ["No_suction","Standard","Boost_IQ","Max"],
3434
},
3535
RobovacCommand.LOCATE: 103,
3636
RobovacCommand.BATTERY: 104,

custom_components/robovac/vacuums/T2119.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class T2119:
1717
)
1818
robovac_features = RoboVacEntityFeature.EDGE | RoboVacEntityFeature.SMALL_ROOM
1919
commands = {
20-
RobovacCommand.PAUSE: 2,
20+
RobovacCommand.START_PAUSE: 2,
2121
RobovacCommand.DIRECTION: {
2222
"code": 3,
2323
"values": ["forward", "back", "left", "right"],
@@ -30,7 +30,7 @@ class T2119:
3030
RobovacCommand.RETURN_HOME: 101,
3131
RobovacCommand.FAN_SPEED: {
3232
"code": 102,
33-
"values": ["No_Suction","Standard","Boost_IQ","Max"],
33+
"values": ["No_suction","Standard","Boost_IQ","Max"],
3434
},
3535
RobovacCommand.LOCATE: 103,
3636
RobovacCommand.BATTERY: 104,

custom_components/robovac/vacuums/T2120.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class T2120:
1717
)
1818
robovac_features = RoboVacEntityFeature.EDGE | RoboVacEntityFeature.SMALL_ROOM
1919
commands = {
20-
RobovacCommand.PAUSE: 2,
20+
RobovacCommand.START_PAUSE: 2,
2121
RobovacCommand.DIRECTION: {
2222
"code": 3,
2323
"values": ["forward", "back", "left", "right"],
@@ -30,7 +30,7 @@ class T2120:
3030
RobovacCommand.RETURN_HOME: 101,
3131
RobovacCommand.FAN_SPEED: {
3232
"code": 102,
33-
"values": ["No_Suction","Standard","Boost_IQ","Max"],
33+
"values": ["No_suction","Standard","Boost_IQ","Max"],
3434
},
3535
RobovacCommand.LOCATE: 103,
3636
RobovacCommand.BATTERY: 104,

custom_components/robovac/vacuums/T2123.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class T2123:
1717
)
1818
robovac_features = RoboVacEntityFeature.EDGE | RoboVacEntityFeature.SMALL_ROOM
1919
commands = {
20-
RobovacCommand.PAUSE: 2,
20+
RobovacCommand.START_PAUSE: 2,
2121
RobovacCommand.DIRECTION: {
2222
"code": 3,
2323
"values": ["forward", "back", "left", "right"],
@@ -30,7 +30,7 @@ class T2123:
3030
RobovacCommand.RETURN_HOME: 101,
3131
RobovacCommand.FAN_SPEED: {
3232
"code": 102,
33-
"values": ["No_Suction","Standard","Boost_IQ","Max"],
33+
"values": ["No_suction","Standard","Boost_IQ","Max"],
3434
},
3535
RobovacCommand.LOCATE: 103,
3636
RobovacCommand.BATTERY: 104,

custom_components/robovac/vacuums/T2128.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class T2128:
1717
)
1818
robovac_features = RoboVacEntityFeature.EDGE | RoboVacEntityFeature.SMALL_ROOM
1919
commands = {
20-
RobovacCommand.PAUSE: 2,
20+
RobovacCommand.START_PAUSE: 2,
2121
RobovacCommand.DIRECTION: {
2222
"code": 3,
2323
"values": ["forward", "back", "left", "right"],
@@ -30,7 +30,7 @@ class T2128:
3030
RobovacCommand.RETURN_HOME: 101,
3131
RobovacCommand.FAN_SPEED: {
3232
"code": 102,
33-
"values": ["No_Suction","Standard","Boost_IQ","Max"],
33+
"values": ["No_suction","Standard","Boost_IQ","Max"],
3434
},
3535
RobovacCommand.LOCATE: 103,
3636
RobovacCommand.BATTERY: 104,

custom_components/robovac/vacuums/T2130.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class T2130:
1717
)
1818
robovac_features = RoboVacEntityFeature.EDGE | RoboVacEntityFeature.SMALL_ROOM
1919
commands = {
20-
RobovacCommand.PAUSE: 2,
20+
RobovacCommand.START_PAUSE: 2,
2121
RobovacCommand.DIRECTION: {
2222
"code": 3,
2323
"values": ["forward", "back", "left", "right"],
@@ -30,7 +30,7 @@ class T2130:
3030
RobovacCommand.RETURN_HOME: 101,
3131
RobovacCommand.FAN_SPEED: {
3232
"code": 102,
33-
"values": ["No_Suction","Standard","Boost_IQ","Max"],
33+
"values": ["No_suction","Standard","Boost_IQ","Max"],
3434
},
3535
RobovacCommand.LOCATE: 103,
3636
RobovacCommand.BATTERY: 104,

0 commit comments

Comments
 (0)