python-roborock 2.50.4__tar.gz → 2.51.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_roborock-2.50.4 → python_roborock-2.51.0}/PKG-INFO +1 -1
- {python_roborock-2.50.4 → python_roborock-2.51.0}/pyproject.toml +1 -1
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/cli.py +28 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/v1/__init__.py +3 -0
- python_roborock-2.51.0/roborock/devices/traits/v1/consumeable.py +47 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/LICENSE +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/README.md +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/__init__.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/api.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/b01_containers.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/broadcast_protocol.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/callbacks.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/clean_modes.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/cloud_api.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/code_mappings.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/command_cache.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/const.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/containers.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/device_features.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/README.md +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/__init__.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/a01_channel.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/b01_channel.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/cache.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/channel.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/device.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/device_manager.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/local_channel.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/mqtt_channel.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/__init__.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/a01/__init__.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/b01/__init__.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/traits_mixin.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/v1/clean_summary.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/v1/common.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/v1/do_not_disturb.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/v1/maps.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/v1/status.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/v1/volume.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/v1_channel.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/v1_rpc_channel.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/exceptions.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/map/map_parser.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/mqtt/__init__.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/mqtt/roborock_session.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/mqtt/session.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/protocol.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/protocols/a01_protocol.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/protocols/b01_protocol.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/protocols/v1_protocol.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/py.typed +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/roborock_future.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/roborock_message.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/roborock_typing.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/util.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/version_1_apis/__init__.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/version_1_apis/roborock_client_v1.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/version_1_apis/roborock_local_client_v1.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/version_1_apis/roborock_mqtt_client_v1.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/version_a01_apis/__init__.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/version_a01_apis/roborock_client_a01.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/version_a01_apis/roborock_mqtt_client_a01.py +0 -0
- {python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/web_api.py +0 -0
|
@@ -21,6 +21,7 @@ roborock> list-devices
|
|
|
21
21
|
roborock> status --device_id <device_id>
|
|
22
22
|
```
|
|
23
23
|
"""
|
|
24
|
+
|
|
24
25
|
import asyncio
|
|
25
26
|
import datetime
|
|
26
27
|
import functools
|
|
@@ -46,6 +47,7 @@ from roborock.devices.device import RoborockDevice
|
|
|
46
47
|
from roborock.devices.device_manager import DeviceManager, create_device_manager, create_home_data_api
|
|
47
48
|
from roborock.devices.traits import Trait
|
|
48
49
|
from roborock.devices.traits.v1 import V1TraitMixin
|
|
50
|
+
from roborock.devices.traits.v1.consumeable import ConsumableAttribute
|
|
49
51
|
from roborock.protocol import MessageParser
|
|
50
52
|
from roborock.version_1_apis.roborock_mqtt_client_v1 import RoborockMqttClientV1
|
|
51
53
|
from roborock.web_api import RoborockApiClient
|
|
@@ -449,6 +451,30 @@ async def maps(ctx, device_id: str):
|
|
|
449
451
|
await _display_v1_trait(context, device_id, lambda v1: v1.maps)
|
|
450
452
|
|
|
451
453
|
|
|
454
|
+
@session.command()
|
|
455
|
+
@click.option("--device_id", required=True)
|
|
456
|
+
@click.pass_context
|
|
457
|
+
@async_command
|
|
458
|
+
async def consumables(ctx, device_id: str):
|
|
459
|
+
"""Get device consumables."""
|
|
460
|
+
context: RoborockContext = ctx.obj
|
|
461
|
+
await _display_v1_trait(context, device_id, lambda v1: v1.consumables)
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
@session.command()
|
|
465
|
+
@click.option("--device_id", required=True)
|
|
466
|
+
@click.option("--consumable", required=True, type=click.Choice([e.value for e in ConsumableAttribute]))
|
|
467
|
+
@click.pass_context
|
|
468
|
+
@async_command
|
|
469
|
+
async def reset_consumable(ctx, device_id: str, consumable: str):
|
|
470
|
+
"""Reset a specific consumable attribute."""
|
|
471
|
+
context: RoborockContext = ctx.obj
|
|
472
|
+
trait = await _v1_trait(context, device_id, lambda v1: v1.consumables)
|
|
473
|
+
attribute = ConsumableAttribute.from_str(consumable)
|
|
474
|
+
await trait.reset_consumable(attribute)
|
|
475
|
+
click.echo(f"Reset {consumable} for device {device_id}")
|
|
476
|
+
|
|
477
|
+
|
|
452
478
|
@click.command()
|
|
453
479
|
@click.option("--device_id", required=True)
|
|
454
480
|
@click.option("--cmd", required=True)
|
|
@@ -691,6 +717,8 @@ cli.add_command(clean_summary)
|
|
|
691
717
|
cli.add_command(volume)
|
|
692
718
|
cli.add_command(set_volume)
|
|
693
719
|
cli.add_command(maps)
|
|
720
|
+
cli.add_command(consumables)
|
|
721
|
+
cli.add_command(reset_consumable)
|
|
694
722
|
|
|
695
723
|
|
|
696
724
|
def main():
|
|
@@ -9,6 +9,7 @@ from roborock.devices.v1_rpc_channel import V1RpcChannel
|
|
|
9
9
|
|
|
10
10
|
from .clean_summary import CleanSummaryTrait
|
|
11
11
|
from .common import V1TraitMixin
|
|
12
|
+
from .consumeable import ConsumableTrait
|
|
12
13
|
from .do_not_disturb import DoNotDisturbTrait
|
|
13
14
|
from .maps import MapsTrait
|
|
14
15
|
from .status import StatusTrait
|
|
@@ -24,6 +25,7 @@ __all__ = [
|
|
|
24
25
|
"CleanSummaryTrait",
|
|
25
26
|
"SoundVolumeTrait",
|
|
26
27
|
"MapsTrait",
|
|
28
|
+
"ConsumableTrait",
|
|
27
29
|
]
|
|
28
30
|
|
|
29
31
|
|
|
@@ -40,6 +42,7 @@ class PropertiesApi(Trait):
|
|
|
40
42
|
clean_summary: CleanSummaryTrait
|
|
41
43
|
sound_volume: SoundVolumeTrait
|
|
42
44
|
maps: MapsTrait
|
|
45
|
+
consumables: ConsumableTrait
|
|
43
46
|
|
|
44
47
|
# In the future optional fields can be added below based on supported features
|
|
45
48
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Trait for managing consumable attributes.
|
|
2
|
+
|
|
3
|
+
A consumable attribute is one that is expected to be replaced or refilled
|
|
4
|
+
periodically, such as filters, brushes, etc.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from enum import StrEnum
|
|
8
|
+
from typing import Self
|
|
9
|
+
|
|
10
|
+
from roborock.containers import Consumable
|
|
11
|
+
from roborock.devices.traits.v1 import common
|
|
12
|
+
from roborock.roborock_typing import RoborockCommand
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"ConsumableTrait",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ConsumableAttribute(StrEnum):
|
|
20
|
+
"""Enum for consumable attributes."""
|
|
21
|
+
|
|
22
|
+
SENSOR_DIRTY_TIME = "sensor_dirty_time"
|
|
23
|
+
FILTER_WORK_TIME = "filter_work_time"
|
|
24
|
+
SIDE_BRUSH_WORK_TIME = "side_brush_work_time"
|
|
25
|
+
MAIN_BRUSH_WORK_TIME = "main_brush_work_time"
|
|
26
|
+
|
|
27
|
+
@classmethod
|
|
28
|
+
def from_str(cls, value: str) -> Self:
|
|
29
|
+
"""Create a ConsumableAttribute from a string value."""
|
|
30
|
+
for member in cls:
|
|
31
|
+
if member.value == value:
|
|
32
|
+
return member
|
|
33
|
+
raise ValueError(f"Unknown ConsumableAttribute: {value}")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ConsumableTrait(Consumable, common.V1TraitMixin):
|
|
37
|
+
"""Trait for managing consumable attributes on Roborock devices.
|
|
38
|
+
|
|
39
|
+
After the first refresh, you can tell what consumables are supported by
|
|
40
|
+
checking which attributes are not None.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
command = RoborockCommand.GET_CONSUMABLE
|
|
44
|
+
|
|
45
|
+
async def reset_consumable(self, consumable: ConsumableAttribute) -> None:
|
|
46
|
+
"""Reset a specific consumable attribute on the device."""
|
|
47
|
+
await self.rpc_channel.send_command(RoborockCommand.RESET_CONSUMABLE, params=[consumable.value])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/v1/clean_summary.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/devices/traits/v1/do_not_disturb.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/version_1_apis/roborock_client_v1.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/version_1_apis/roborock_mqtt_client_v1.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_roborock-2.50.4 → python_roborock-2.51.0}/roborock/version_a01_apis/roborock_client_a01.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|