Skip to content

Commit 2f3ee9c

Browse files
committed
chore: refactor to seperate b01 ss and sc logic
1 parent 0c763e6 commit 2f3ee9c

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
"""Traits for B01 devices."""
22

3-
from roborock import RoborockB01Methods
4-
from roborock.devices.b01_channel import send_decoded_command
5-
from roborock.devices.mqtt_channel import MqttChannel
6-
from roborock.devices.traits import Trait
7-
from roborock.roborock_message import RoborockB01Props
3+
from .sc import PropertiesApi
84

9-
__all__ = [
10-
"PropertiesApi",
11-
]
12-
13-
14-
class PropertiesApi(Trait):
15-
"""API for interacting with B01 devices."""
16-
17-
def __init__(self, channel: MqttChannel) -> None:
18-
"""Initialize the B01Props API."""
19-
self._channel = channel
20-
21-
async def query_values(self, props: list[RoborockB01Props]) -> None:
22-
"""Query the device for the values of the given Dyad protocols."""
23-
await send_decoded_command(
24-
self._channel, dps=10000, command=RoborockB01Methods.GET_PROP, params={"property": props}
25-
)
26-
27-
28-
def create(channel: MqttChannel) -> PropertiesApi:
29-
"""Create traits for B01 devices."""
30-
return PropertiesApi(channel)
5+
__all__ = ["PropertiesApi", "sc", "ss"]

0 commit comments

Comments
 (0)