@@ -103,6 +103,8 @@ def __init__(self, endpoint: str, device_info: DeviceData) -> None:
103103 self ._last_disconnection = self .time_func ()
104104 self .keep_alive = KEEPALIVE
105105 self ._diagnostic_data : dict [str , dict [str , Any ]] = {}
106+ self .dnd_timer : DnDTimer | None = None
107+ self .valley_timer : ValleyElectricityTimer | None = None
106108
107109 def __del__ (self ) -> None :
108110 self .sync_disconnect ()
@@ -255,11 +257,19 @@ async def get_status(self) -> Status | None:
255257
256258 @fallback_cache
257259 async def get_dnd_timer (self ) -> DnDTimer | None :
258- return await self .send_command (RoborockCommand .GET_DND_TIMER , return_type = DnDTimer )
260+ result = await self .send_command (RoborockCommand .GET_DND_TIMER , return_type = DnDTimer )
261+ if result is not None :
262+ self .dnd_timer = result
263+ return result
259264
260265 @fallback_cache
261266 async def get_valley_electricity_timer (self ) -> ValleyElectricityTimer | None :
262- return await self .send_command (RoborockCommand .GET_VALLEY_ELECTRICITY_TIMER , return_type = ValleyElectricityTimer )
267+ result = await self .send_command (
268+ RoborockCommand .GET_VALLEY_ELECTRICITY_TIMER , return_type = ValleyElectricityTimer
269+ )
270+ if result is not None :
271+ self .valley_timer = result
272+ return result
263273
264274 @fallback_cache
265275 async def get_clean_summary (self ) -> CleanSummary | None :
@@ -323,13 +333,11 @@ async def get_dock_summary(self, dock_type: RoborockDockTypeCode) -> DockSummary
323333 @fallback_cache
324334 async def get_prop (self ) -> DeviceProp | None :
325335 """Gets device general properties."""
326- [status , clean_summary , consumable , dnd_timer , valley_electricity_timer ] = await asyncio .gather (
336+ [status , clean_summary , consumable ] = await asyncio .gather (
327337 * [
328338 self .get_status (),
329339 self .get_clean_summary (),
330340 self .get_consumable (),
331- self .get_dnd_timer (),
332- self .get_valley_electricity_timer (),
333341 ]
334342 )
335343 last_clean_record = None
@@ -338,13 +346,11 @@ async def get_prop(self) -> DeviceProp | None:
338346 dock_summary = None
339347 if status and status .dock_type is not None and status .dock_type != RoborockDockTypeCode .no_dock :
340348 dock_summary = await self .get_dock_summary (status .dock_type )
341- if any ([status , dnd_timer , clean_summary , consumable ]):
349+ if any ([status , clean_summary , consumable ]):
342350 return DeviceProp (
343351 status ,
344352 clean_summary ,
345353 consumable ,
346- dnd_timer ,
347- valley_electricity_timer ,
348354 last_clean_record ,
349355 dock_summary ,
350356 )
0 commit comments