@@ -168,7 +168,52 @@ class VeSyncAirBypass(VeSyncBaseDevice):
168168 """Base class for Levoit Purifier Bypass API Calls."""
169169
170170 def __init__ (self , details : Dict [str , list ], manager ):
171- """Initialize air devices."""
171+ """Initialize air purifier devices.
172+
173+ Instantiated by VeSync manager object. Inherits from
174+ VeSyncBaseDevice class.
175+
176+ Arguments
177+ ----------
178+ details : dict
179+ Dictionary of device details
180+ manager : VeSync
181+ Instantiated VeSync object used to make API calls
182+
183+ Attributes
184+ ----------
185+ modes : list
186+ List of available operation modes for device
187+ air_quality_feature : bool
188+ True if device has air quality sensor
189+ details : dict
190+ Dictionary of device details
191+ timer : Timer
192+ Timer object for device, None if no timer exists. See `Timer` class
193+ config : dict
194+ Dictionary of device configuration
195+
196+ Notes
197+ -----
198+ The `details` attribute holds device information that is updated when
199+ the `update()` method is called. An example of the `details` attribute:
200+ >>> {
201+ >>> 'filter_life': 0,
202+ >>> 'mode': 'manual',
203+ >>> 'level': 0,
204+ >>> 'display': False,
205+ >>> 'child_lock': False,
206+ >>> 'night_light': 'off',
207+ >>> 'air_quality': 0 # air quality level
208+ >>> 'air_quality_value': 0, # PM2.5 value from device,
209+ >>> 'display_forever': False
210+ >>> }
211+
212+ See Also
213+ --------
214+ VeSyncBaseDevice : Parent class for all VeSync devices
215+
216+ """
172217 super ().__init__ (details , manager )
173218 self .enabled = True
174219 self ._config_dict = model_features (self .device_type )
@@ -297,7 +342,31 @@ def update(self):
297342 self .get_details ()
298343
299344 def get_timer (self ) -> Optional [Timer ]:
300- """Retrieve running timer from purifier."""
345+ """Retrieve running timer from purifier.
346+
347+ Returns Timer object if timer is running, None if no timer is running.
348+
349+ Arguments
350+ ----------
351+ None
352+
353+ Returns
354+ -------
355+ Timer or None
356+
357+ Notes
358+ -----
359+ Timer object tracks the time remaining based on the last update. Timer
360+ properties include `status`, `time_remaining`, `duration`, `action`,
361+ `paused` and `done`. The methods `start()`, `end()` and `pause()`
362+ are available but should be called through the purifier object
363+ to update through the API.
364+
365+ See Also
366+ --------
367+ Timer : Timer object used to track device timers
368+
369+ """
301370 head , body = self .build_api_dict ('getTimer' )
302371 body ['payload' ]['data' ] = {}
303372 if not head and not body :
@@ -345,6 +414,11 @@ def set_timer(self, timer_duration: int) -> bool:
345414 ----------
346415 timer_duration: int
347416 Duration of timer in seconds
417+
418+ Returns
419+ -------
420+ bool
421+
348422 """
349423 if self .device_status != 'on' :
350424 logger .debug ("Can't set timer when device is off" )
@@ -382,7 +456,15 @@ def set_timer(self, timer_duration: int) -> bool:
382456 return True
383457
384458 def clear_timer (self ) -> bool :
385- """Clear timer."""
459+ """Clear timer.
460+
461+ Returns True if no error is returned from API call.
462+
463+ Returns
464+ -------
465+ bool
466+
467+ """
386468 self .get_timer ()
387469 if self .timer is None :
388470 logger .debug ('No timer to clear' )
@@ -465,7 +547,20 @@ def child_lock_off(self) -> bool:
465547 return self .set_child_lock (False )
466548
467549 def set_child_lock (self , mode : bool ) -> bool :
468- """Set Bypass child lock."""
550+ """Set Bypass child lock.
551+
552+ Set child lock to on or off.
553+
554+ Arguments
555+ ----------
556+ mode: bool
557+ True to turn child lock on, False to turn off
558+
559+ Returns
560+ -------
561+ bool
562+
563+ """
469564 if mode not in (True , False ):
470565 logger .debug ('Invalid mode passed to set_child_lock - %s' , mode )
471566 return False
@@ -519,7 +614,20 @@ def reset_filter(self) -> bool:
519614 return False
520615
521616 def mode_toggle (self , mode : str ) -> bool :
522- """Set purifier mode - sleep or manual."""
617+ """Set purifier mode - sleep or manual.
618+
619+ Set purifier mode based on devices available modes.
620+
621+ Arguments
622+ ----------
623+ mode: str
624+ Mode to set purifier. Based on device modes in attribute `modes`
625+
626+ Returns
627+ -------
628+ bool
629+
630+ """
523631 if mode .lower () not in self .modes :
524632 logger .debug ('Invalid purifier mode used - %s' ,
525633 mode )
0 commit comments