-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathprops.py
More file actions
31 lines (21 loc) · 866 Bytes
/
props.py
File metadata and controls
31 lines (21 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from __future__ import annotations
import logging
from typing import Any
from roborock import RoborockB01Methods
from roborock.roborock_message import RoborockB01Props
from ...b01_channel import send_decoded_command
from ...mqtt_channel import MqttChannel
from ..trait import Trait
_LOGGER = logging.getLogger(__name__)
__all__ = [
"B01PropsApi",
]
class B01PropsApi(Trait):
"""API for interacting with B01 devices."""
name = "B01_props"
def __init__(self, channel: MqttChannel) -> None:
"""Initialize the B01Props API."""
self._channel = channel
async def query_values(self, props: list[RoborockB01Props]) -> dict[int, Any]:
"""Query the device for the values of the given Dyad protocols."""
return await send_decoded_command(self._channel, dps=10000, command=RoborockB01Methods.GET_PROP, params=props)