Skip to content

Commit 63267e7

Browse files
Merge pull request #29 from Lash-L/none_device_prop
2 parents 0dc3294 + 111d762 commit 63267e7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

roborock/typing.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import typing
34
from dataclasses import dataclass
45
from enum import Enum
56

@@ -183,7 +184,7 @@ class CommandInfo:
183184
RoborockCommand.TEST_SOUND_VOLUME: CommandInfo(prefix=b'\x00\x00\x00w'),
184185
RoborockCommand.UPD_SERVER_TIMER: CommandInfo(prefix=b'\x00\x00\x00w'),
185186
RoborockCommand.SET_APP_TIMEZONE: CommandInfo(prefix=b'\x00\x00\x97'),
186-
#TODO discover prefix for following commands
187+
# TODO discover prefix for following commands
187188
# RoborockCommand.APP_GET_DRYER_SETTING: CommandInfo(prefix=b'\x00\x00\x00w'),
188189
# RoborockCommand.APP_SET_DRYER_SETTING: CommandInfo(prefix=b'\x00\x00\x00w'),
189190
# RoborockCommand.GET_DUST_COLLECTION_MODE: CommandInfo(prefix=b'\x00\x00\x00w'),
@@ -207,15 +208,14 @@ def __init__(self, dust_collection_mode: DustCollectionMode,
207208
self.smart_wash_params = smart_wash_params
208209

209210

211+
@dataclass
210212
class RoborockDeviceProp:
211-
def __init__(self, status: Status, dnd_timer: DNDTimer, clean_summary: CleanSummary, consumable: Consumable,
212-
last_clean_record: CleanRecord = None, dock_summary: RoborockDockSummary = None):
213-
self.status = status
214-
self.dnd_timer = dnd_timer
215-
self.clean_summary = clean_summary
216-
self.consumable = consumable
217-
self.last_clean_record = last_clean_record
218-
self.dock_summary = dock_summary
213+
status: typing.Optional[Status] = None
214+
dnd_timer: typing.Optional[DNDTimer] = None
215+
clean_summary: typing.Optional[CleanSummary] = None
216+
consumable: typing.Optional[Consumable] = None
217+
last_clean_record: typing.Optional[CleanRecord] = None
218+
dock_summary: typing.Optional[RoborockDockSummary] = None
219219

220220
def update(self, device_prop: 'RoborockDeviceProp'):
221221
if device_prop.status:

0 commit comments

Comments
 (0)