Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions roborock/typing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import typing
from dataclasses import dataclass
from enum import Enum

Expand Down Expand Up @@ -183,7 +184,7 @@ class CommandInfo:
RoborockCommand.TEST_SOUND_VOLUME: CommandInfo(prefix=b'\x00\x00\x00w'),
RoborockCommand.UPD_SERVER_TIMER: CommandInfo(prefix=b'\x00\x00\x00w'),
RoborockCommand.SET_APP_TIMEZONE: CommandInfo(prefix=b'\x00\x00\x97'),
#TODO discover prefix for following commands
# TODO discover prefix for following commands
# RoborockCommand.APP_GET_DRYER_SETTING: CommandInfo(prefix=b'\x00\x00\x00w'),
# RoborockCommand.APP_SET_DRYER_SETTING: CommandInfo(prefix=b'\x00\x00\x00w'),
# RoborockCommand.GET_DUST_COLLECTION_MODE: CommandInfo(prefix=b'\x00\x00\x00w'),
Expand All @@ -207,15 +208,14 @@ def __init__(self, dust_collection_mode: DustCollectionMode,
self.smart_wash_params = smart_wash_params


@dataclass
class RoborockDeviceProp:
def __init__(self, status: Status, dnd_timer: DNDTimer, clean_summary: CleanSummary, consumable: Consumable,
last_clean_record: CleanRecord = None, dock_summary: RoborockDockSummary = None):
self.status = status
self.dnd_timer = dnd_timer
self.clean_summary = clean_summary
self.consumable = consumable
self.last_clean_record = last_clean_record
self.dock_summary = dock_summary
status: typing.Optional[Status] = None
dnd_timer: typing.Optional[DNDTimer] = None
clean_summary: typing.Optional[CleanSummary] = None
consumable: typing.Optional[Consumable] = None
last_clean_record: typing.Optional[CleanRecord] = None
dock_summary: typing.Optional[RoborockDockSummary] = None

def update(self, device_prop: 'RoborockDeviceProp'):
if device_prop.status:
Expand Down