1
1
from __future__ import annotations
2
2
3
+ import typing
3
4
from dataclasses import dataclass
4
5
from enum import Enum
5
6
@@ -183,7 +184,7 @@ class CommandInfo:
183
184
RoborockCommand .TEST_SOUND_VOLUME : CommandInfo (prefix = b'\x00 \x00 \x00 w' ),
184
185
RoborockCommand .UPD_SERVER_TIMER : CommandInfo (prefix = b'\x00 \x00 \x00 w' ),
185
186
RoborockCommand .SET_APP_TIMEZONE : CommandInfo (prefix = b'\x00 \x00 \x97 ' ),
186
- #TODO discover prefix for following commands
187
+ # TODO discover prefix for following commands
187
188
# RoborockCommand.APP_GET_DRYER_SETTING: CommandInfo(prefix=b'\x00\x00\x00w'),
188
189
# RoborockCommand.APP_SET_DRYER_SETTING: CommandInfo(prefix=b'\x00\x00\x00w'),
189
190
# RoborockCommand.GET_DUST_COLLECTION_MODE: CommandInfo(prefix=b'\x00\x00\x00w'),
@@ -207,15 +208,14 @@ def __init__(self, dust_collection_mode: DustCollectionMode,
207
208
self .smart_wash_params = smart_wash_params
208
209
209
210
211
+ @dataclass
210
212
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
219
219
220
220
def update (self , device_prop : 'RoborockDeviceProp' ):
221
221
if device_prop .status :
0 commit comments