VeSync Air Purifiers↲
Contents:↲
- PurifierState Class
- VeSyncAirBypass Purifiers - Most common model
- VeSyncAirBaseV2 Purifiers - Newer models
- VeSyncAir131 Purifiers - PUR-LV131S Purifiers
- VeSyncPurifier Base Device - Abstract base class
pyvesync.base_devices.purifier_base.PurifierState ↲
Bases: DeviceState
Base state class for Purifiers.
Attributes:
Name | Type | Description |
---|---|---|
active_time |
int
|
Active time of device, defaults to None. |
connection_status |
str
|
Connection status of device. |
device |
VeSyncOutlet
|
Device object. |
device_status |
str
|
Device status. |
features |
dict
|
Features of device. |
last_update_ts |
int
|
Last update timestamp of device, defaults to None. |
mode |
str
|
Current mode of the purifier. |
fan_level |
int
|
Current fan level of the purifier. |
fan_set_level |
int
|
Set fan level of the purifier. |
filter_life |
int
|
Filter life percentage of the purifier. |
auto_preference_type |
str
|
Auto preference type of the purifier. |
auto_room_size |
int
|
Auto room size of the purifier. |
air_quality_level |
AirQualityLevel
|
Air quality level of the purifier. |
child_lock |
bool
|
Child lock status of the purifier. |
display_status |
str
|
Display status of the purifier. |
display_set_state |
str
|
Display set state of the purifier. |
display_forever |
bool
|
Display forever status of the purifier. |
timer |
Timer
|
Timer object for the purifier. |
pm25 |
int
|
PM2.5 value of the purifier. |
pm1 |
int
|
PM1 value of the purifier. |
pm10 |
int
|
PM10 value of the purifier. |
aq_percent |
int
|
Air quality percentage of the purifier. |
light_detection_switch |
str
|
Light detection switch status of the purifier. |
light_detection_status |
str
|
Light detection status of the purifier. |
nightlight_status |
str
|
Nightlight status of the purifier. |
fan_rotate_angle |
int
|
Fan rotate angle of the purifier. |
Note
Not all attributes are supported by all models.
Source code in src\pyvesync\base_devices\purifier_base.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
Attributes↲
air_quality_level
property
writable
↲
Return air quality level in integer from 1-4.
Returns -1 if unknown.
connection_status
instance-attribute
↲
Inherited From DeviceState
device_status
instance-attribute
↲
Inherited From DeviceState
Functions↲
as_tuple ↲
Inherited From DeviceState
Convert state to tuple of (name, value) tuples.
display ↲
Inherited From DeviceState
Print formatted state to stdout.
set_air_quality_level ↲
Set air quality level.
Source code in src\pyvesync\base_devices\purifier_base.py
to_dict ↲
Inherited From DeviceState
Convert state to dictionary.
to_json ↲
Inherited From DeviceState
Dump state to JSON string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
indent
|
bool
|
If True, indent JSON output, defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device state. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From DeviceState
Convert state to JSON bytes.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
update_ts ↲
Inherited From DeviceState
Update last update timestamp.
pyvesync.devices.vesyncpurifier.VeSyncAirBypass ↲
Bases: BypassV2Mixin
, VeSyncPurifier
Initialize air purifier devices.
Instantiated by VeSync manager object. Inherits from VeSyncBaseDevice class. This is the primary class for most air purifiers, using the Bypass V2 API, except the original LV-PUR131S.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
details
|
dict
|
Dictionary of device details |
required |
manager
|
VeSync
|
Instantiated VeSync object used to make API calls |
required |
feature_map
|
PurifierMap
|
Device map template |
required |
Attributes:
Name | Type | Description |
---|---|---|
state |
PurifierState
|
State of the device. |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
pid |
str
|
Product ID of device, pulled by some devices on update. |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
features |
dict
|
Features of device. |
modes |
list[str]
|
List of modes supported by the device. |
fan_levels |
list[int]
|
List of fan levels supported by the device. |
nightlight_modes |
list[str]
|
List of nightlight modes supported by the device. |
auto_preferences |
list[str]
|
List of auto preferences supported by the device. |
Notes
The details
attribute holds device information that is updated when
the update()
method is called. An example of the details
attribute:
json.dumps(self.details, indent=4)
{
'filter_life': 0,
'mode': 'manual',
'level': 0,
'display': False,
'child_lock': False,
'night_light': 'off',
'air_quality': 0 # air quality level
'air_quality_value': 0, # PM2.5 value from device,
'display_forever': False
}
Source code in src\pyvesync\devices\vesyncpurifier.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
|
Attributes↲
air_quality
property
↲
Inherited From VeSyncAirBypass
Get air quality value PM2.5 (ug/m3).
auto_preferences
instance-attribute
↲
Inherited From VeSyncPurifier
child_lock
property
↲
Inherited From VeSyncPurifier
Get child lock state.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if child lock is enabled, False if not. |
config_module
instance-attribute
↲
Inherited From VeSyncBaseDevice
connection_type
instance-attribute
↲
Inherited From VeSyncBaseDevice
current_firm_version
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_image
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_region
instance-attribute
↲
Inherited From VeSyncBaseDevice
display_state
property
↲
Inherited From VeSyncAirBypass
Get display state.
See [pyvesync.VeSyncAirBypass.display_status][self.display_status
]
filter_life
property
↲
Inherited From VeSyncAirBypass
Get percentage of filter life remaining.
firmware_update
property
↲
Inherited From VeSyncBaseDevice
Return True if firmware update available.
This is going to be updated.
last_response
instance-attribute
↲
last_response: ResponseInfo | None = None
Inherited From VeSyncBaseDevice
night_light
property
↲
Inherited From VeSyncPurifier
Get night light state.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Night light state (on, dim, off) |
nightlight_modes
instance-attribute
↲
Inherited From VeSyncPurifier
request_keys
class-attribute
↲
request_keys: list[str] = [
'acceptLanguage',
'appVersion',
'phoneBrand',
'phoneOS',
'accountID',
'cid',
'configModule',
'debugMode',
'traceId',
'timeZone',
'token',
'userCountryCode',
'configModel',
'deviceId',
]
Inherited From BypassV2Mixin
screen_status
property
↲
Inherited From VeSyncAirBypass
Get display status.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if display is on, False if off |
state
instance-attribute
↲
state: PurifierState = PurifierState(
self, details, feature_map
)
Inherited From VeSyncBaseDevice
sub_device_no
instance-attribute
↲
Inherited From VeSyncBaseDevice
supports_air_quality
property
↲
Inherited From VeSyncPurifier
Return True if device supports air quality.
supports_fan_rotate
property
↲
Inherited From VeSyncPurifier
Return True if device supports fan rotation.
supports_light_detection
property
↲
Inherited From VeSyncPurifier
Returns True if device supports light detection.
supports_nightlight
property
↲
Inherited From VeSyncPurifier
Return True if device supports nightlight.
Functions↲
auto_mode
async
deprecated
↲
call_bypassv2_api
async
↲
call_bypassv2_api(
payload_method: str,
data: dict | None = None,
method: str = 'bypassV2',
endpoint: str = 'bypassV2',
) -> dict | None
Inherited From BypassV2Mixin
Send Bypass V2 API request.
This uses the _build_request
method to send API requests to the Bypass V2 API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
payload_method
|
str
|
The method to use in the payload dict. |
required |
data
|
dict | None
|
The data to send in the request. |
None
|
method
|
str
|
The method to use in the outer body. |
'bypassV2'
|
endpoint
|
str | None
|
The last part of the API url, defaults to
|
'bypassV2'
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
dict | None
|
The response from the API request. |
Source code in src\pyvesync\utils\device_mixins.py
change_fan_speed
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use set_fan_speed()
instead.
Deprecated method for changing fan speed.
change_mode
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use set_mode(mode: str)
instead.
Deprecated method for changing purifier mode.
child_lock_off
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_off_child_lock()
instead.
Turn off child lock (display lock).
This has been deprecated, use turn_off_child_lock()
instead.
Source code in src\pyvesync\base_devices\purifier_base.py
child_lock_on
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_on_child_lock()
instead.
Turn on child lock (display lock).
This has been deprecated, use turn_on_child_lock()
instead.
Source code in src\pyvesync\base_devices\purifier_base.py
clear_timer
async
↲
Inherited From VeSyncBaseDevice
Clear timer for device from API.
This may not be implemented for all devices. Please open an issue if there is an error.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
display ↲
Inherited From VeSyncBaseDevice
Print formatted static device info to stdout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in display, defaults to True. |
True
|
Example:
Device Name:..................Living Room Lamp
Model:........................ESL100
Subdevice No:.................0
Type:.........................wifi
CID:..........................1234567890abcdef
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
displayJSON
deprecated
↲
Inherited From VeSyncBaseDevice
Deprecated
Use to_json() instead
Return JSON details for device. - Deprecated use to_json().
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
get_details
async
↲
Inherited From VeSyncBaseDevice
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state
attribute. The update()
method should
be called to update the device state.
Source code in src\pyvesync\devices\vesyncpurifier.py
get_state ↲
Inherited From VeSyncBaseDevice
Get device state attribute.
get_timer
async
↲
get_timer() -> Timer | None
Inherited From VeSyncBaseDevice
Get timer for device from API and set the state.Timer
attribute.
This may not be implemented for all devices. Please open an issue if there is an error.
Note
This method may not be implemented for all devices. Please open an issue if there is an error.
Source code in src\pyvesync\devices\vesyncpurifier.py
manual_mode
async
deprecated
↲
mode_toggle
async
deprecated
↲
Inherited From VeSyncAirBypass
Deprecated
Use set_mode(mode: str) instead.
Deprecated method for setting purifier mode.
nightlight_mode
async
deprecated
↲
pet_mode
async
deprecated
↲
reset_filter
async
↲
Inherited From VeSyncPurifier
Reset filter life.
Reset filter to 100%.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if filter is reset, False if not |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_auto_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Auto Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_auto_preference
async
↲
Inherited From VeSyncPurifier
Set auto preference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preference
|
str
|
Auto preference to set, available preference is
found in |
required |
room_size
|
int
|
Room size to set, defaults to 800ft2. |
800
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_child_lock
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use toggle_child_lock()
instead.
Set child lock (display lock).
This has been deprecated in favor of toggle_child_lock()
.
Source code in src\pyvesync\base_devices\purifier_base.py
set_fan_speed
async
↲
Inherited From VeSyncPurifier
Set Purifier Fan Speed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
speed
|
int | None
|
Fan speed to set. If None, use default speed. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_light_detection_off
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_off_light_detection() instead.
Turn off light detection feature.
set_light_detection_on
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_on_light_detection() instead.
Turn on light detection feature.
set_manual_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Manual Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier Mode.
Allowed modes are found in the device.modes
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
Mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_nightlight_dim
async
↲
Inherited From VeSyncPurifier
Set Nightlight Dim.
set_nightlight_mode
async
↲
Inherited From VeSyncPurifier
Set Nightlight Mode.
Modes are defined in the device.nightlight_modes
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
Nightlight mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_pet_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Pet Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_sleep_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Sleep Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_state ↲
Inherited From VeSyncBaseDevice
Set device state attribute.
set_timer
async
↲
Inherited From VeSyncBaseDevice
Set timer for device.
This may not be implemented for all devices. Please open an issue if there is an error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
Duration in seconds. |
required |
action
|
str | None
|
Action to take when timer expires. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_turbo_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Turbo Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
sleep_mode
async
deprecated
↲
to_dict ↲
Inherited From VeSyncBaseDevice
Return device information as a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in dictionary, defaults to True. |
True
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: Dictionary containing device information. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_json ↲
Inherited From VeSyncBaseDevice
Print JSON API string for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device details. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From VeSyncBaseDevice
JSON API bytes for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
JSON formatted bytes of device details. |
Example
This is an example without state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
toggle_child_lock
async
↲
Inherited From VeSyncPurifier
Toggle Child Lock (Display Lock).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
Toggle child lock. If None, toggle state. |
None
|
Toggle child lock.
Set child lock to on or off. Internal method used by turn_on_child_lock
and
turn_off_child_lock
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool
|
True to turn child lock on, False to turn off |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if child lock is set, False if not |
Source code in src\pyvesync\devices\vesyncpurifier.py
toggle_display
async
↲
Inherited From VeSyncPurifier
Set Display Mode.
Source code in src\pyvesync\devices\vesyncpurifier.py
toggle_light_detection
async
↲
Inherited From VeSyncPurifier
Set Light Detection Mode.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
Toggle light detection. If None, toggle state. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\purifier_base.py
toggle_switch
async
↲
Inherited From VeSyncBaseToggleDevice
Toggle device power on or off.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
True to turn on, False to turn off, None to toggle. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
turbo_mode
async
deprecated
↲
turn_off
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device off.
turn_off_child_lock
async
↲
Inherited From VeSyncPurifier
Set child lock (display lock) to OFF.
turn_off_display
async
↲
Inherited From VeSyncPurifier
Turn off Display.
turn_off_light_detection
async
↲
Inherited From VeSyncPurifier
Turn off Light Detection.
turn_off_nightlight
async
↲
Inherited From VeSyncPurifier
Turn off Nightlight.
turn_on
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device on.
turn_on_child_lock
async
↲
Inherited From VeSyncPurifier
Set child lock (display lock) to ON.
turn_on_display
async
↲
Inherited From VeSyncPurifier
Turn on Display.
turn_on_light_detection
async
↲
Inherited From VeSyncPurifier
Turn on Light Detection.
turn_on_nightlight
async
↲
Inherited From VeSyncPurifier
Turn on Nightlight.
update
async
↲
Inherited From VeSyncBaseDevice
Update device details.
pyvesync.devices.vesyncpurifier.VeSyncAirBaseV2 ↲
Bases: VeSyncAirBypass
Levoit V2 Air Purifier Class.
Inherits from VeSyncAirBypass and VeSyncBaseDevice class. For newer devices that use camel-case API calls.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
details
|
dict
|
Dictionary of device details |
required |
manager
|
VeSync
|
Instantiated VeSync object |
required |
feature_map
|
PurifierMap
|
Device map template |
required |
Attributes:
Name | Type | Description |
---|---|---|
state |
PurifierState
|
State of the device. |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
pid |
str
|
Product ID of device, pulled by some devices on update. |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
features |
dict
|
Features of device. |
modes |
list[str]
|
List of modes supported by the device. |
fan_levels |
list[int]
|
List of fan levels supported by the device. |
nightlight_modes |
list[str]
|
List of nightlight modes supported by the device. |
auto_preferences |
list[str]
|
List of auto preferences supported by the device. |
Source code in src\pyvesync\devices\vesyncpurifier.py
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 |
|
Attributes↲
air_quality
property
↲
Inherited From VeSyncAirBypass
Get air quality value PM2.5 (ug/m3).
auto_preferences
instance-attribute
↲
Inherited From VeSyncPurifier
child_lock
property
↲
Inherited From VeSyncPurifier
Get child lock state.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if child lock is enabled, False if not. |
config_module
instance-attribute
↲
Inherited From VeSyncBaseDevice
connection_type
instance-attribute
↲
Inherited From VeSyncBaseDevice
current_firm_version
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_image
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_region
instance-attribute
↲
Inherited From VeSyncBaseDevice
display_state
property
↲
Inherited From VeSyncAirBypass
Get display state.
See [pyvesync.VeSyncAirBypass.display_status][self.display_status
]
filter_life
property
↲
Inherited From VeSyncAirBypass
Get percentage of filter life remaining.
firmware_update
property
↲
Inherited From VeSyncBaseDevice
Return True if firmware update available.
This is going to be updated.
last_response
instance-attribute
↲
last_response: ResponseInfo | None = None
Inherited From VeSyncBaseDevice
night_light
property
↲
Inherited From VeSyncPurifier
Get night light state.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Night light state (on, dim, off) |
nightlight_modes
instance-attribute
↲
Inherited From VeSyncPurifier
request_keys
class-attribute
↲
request_keys: list[str] = [
'acceptLanguage',
'appVersion',
'phoneBrand',
'phoneOS',
'accountID',
'cid',
'configModule',
'debugMode',
'traceId',
'timeZone',
'token',
'userCountryCode',
'configModel',
'deviceId',
]
Inherited From BypassV2Mixin
screen_status
property
↲
Inherited From VeSyncAirBypass
Get display status.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if display is on, False if off |
state
instance-attribute
↲
state: PurifierState = PurifierState(
self, details, feature_map
)
Inherited From VeSyncBaseDevice
sub_device_no
instance-attribute
↲
Inherited From VeSyncBaseDevice
supports_air_quality
property
↲
Inherited From VeSyncPurifier
Return True if device supports air quality.
supports_fan_rotate
property
↲
Inherited From VeSyncPurifier
Return True if device supports fan rotation.
supports_light_detection
property
↲
Inherited From VeSyncPurifier
Returns True if device supports light detection.
supports_nightlight
property
↲
Inherited From VeSyncPurifier
Return True if device supports nightlight.
Functions↲
auto_mode
async
deprecated
↲
call_bypassv2_api
async
↲
call_bypassv2_api(
payload_method: str,
data: dict | None = None,
method: str = 'bypassV2',
endpoint: str = 'bypassV2',
) -> dict | None
Inherited From BypassV2Mixin
Send Bypass V2 API request.
This uses the _build_request
method to send API requests to the Bypass V2 API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
payload_method
|
str
|
The method to use in the payload dict. |
required |
data
|
dict | None
|
The data to send in the request. |
None
|
method
|
str
|
The method to use in the outer body. |
'bypassV2'
|
endpoint
|
str | None
|
The last part of the API url, defaults to
|
'bypassV2'
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
dict | None
|
The response from the API request. |
Source code in src\pyvesync\utils\device_mixins.py
change_fan_speed
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use set_fan_speed()
instead.
Deprecated method for changing fan speed.
change_mode
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use set_mode(mode: str)
instead.
Deprecated method for changing purifier mode.
child_lock_off
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_off_child_lock()
instead.
Turn off child lock (display lock).
This has been deprecated, use turn_off_child_lock()
instead.
Source code in src\pyvesync\base_devices\purifier_base.py
child_lock_on
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_on_child_lock()
instead.
Turn on child lock (display lock).
This has been deprecated, use turn_on_child_lock()
instead.
Source code in src\pyvesync\base_devices\purifier_base.py
clear_timer
async
↲
Inherited From VeSyncAirBypass
Clear timer for device from API.
This may not be implemented for all devices. Please open an issue if there is an error.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
display ↲
Inherited From VeSyncBaseDevice
Print formatted static device info to stdout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in display, defaults to True. |
True
|
Example:
Device Name:..................Living Room Lamp
Model:........................ESL100
Subdevice No:.................0
Type:.........................wifi
CID:..........................1234567890abcdef
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
displayJSON
deprecated
↲
Inherited From VeSyncBaseDevice
Deprecated
Use to_json() instead
Return JSON details for device. - Deprecated use to_json().
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
get_details
async
↲
Inherited From VeSyncAirBypass
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state
attribute. The update()
method should
be called to update the device state.
Build API V2 Purifier details dictionary.
Source code in src\pyvesync\devices\vesyncpurifier.py
get_state ↲
Inherited From VeSyncBaseDevice
Get device state attribute.
get_timer
async
↲
get_timer() -> Timer | None
Inherited From VeSyncBaseDevice
Get timer for device from API and set the state.Timer
attribute.
This may not be implemented for all devices. Please open an issue if there is an error.
Note
This method may not be implemented for all devices. Please open an issue if there is an error.
Source code in src\pyvesync\devices\vesyncpurifier.py
manual_mode
async
deprecated
↲
mode_toggle
async
deprecated
↲
Inherited From VeSyncAirBypass
Deprecated
Use set_mode(mode: str) instead.
Deprecated method for setting purifier mode.
nightlight_mode
async
deprecated
↲
pet_mode
async
deprecated
↲
reset_filter
async
↲
Inherited From VeSyncPurifier
Reset filter life.
Reset filter to 100%.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if filter is reset, False if not |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_auto_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Auto Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_auto_preference
async
↲
Inherited From VeSyncAirBypass
Set auto preference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preference
|
str
|
Auto preference to set, available preference is
found in |
DEFAULT
|
room_size
|
int
|
Room size to set, defaults to 800ft2. |
600
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Set Levoit Vital 100S/200S auto mode.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preference
|
str | None | PurifierAutoPreference
|
Preference for auto mode, default 'default' (default, efficient, quiet) |
DEFAULT
|
room_size
|
int | None
|
Room size in square feet, by default 600 |
600
|
Source code in src\pyvesync\devices\vesyncpurifier.py
set_child_lock
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use toggle_child_lock()
instead.
Set child lock (display lock).
This has been deprecated in favor of toggle_child_lock()
.
Source code in src\pyvesync\base_devices\purifier_base.py
set_fan_speed
async
↲
Inherited From VeSyncAirBypass
Set Purifier Fan Speed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
speed
|
int | None
|
Fan speed to set. If None, use default speed. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_light_detection
async
deprecated
↲
Deprecated
Use toggle_light_detection(toggle) instead.
Set light detection feature.
set_light_detection_off
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_off_light_detection() instead.
Turn off light detection feature.
set_light_detection_on
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_on_light_detection() instead.
Turn on light detection feature.
set_manual_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Manual Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_mode
async
↲
Inherited From VeSyncAirBypass
Set Purifier Mode.
Allowed modes are found in the device.modes
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
Mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_nightlight_dim
async
↲
Inherited From VeSyncPurifier
Set Nightlight Dim.
set_nightlight_mode
async
↲
Inherited From VeSyncPurifier
Set Nightlight Mode.
Modes are defined in the device.nightlight_modes
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
Nightlight mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_pet_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Pet Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_sleep_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Sleep Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_state ↲
Inherited From VeSyncBaseDevice
Set device state attribute.
set_timer
async
↲
Inherited From VeSyncAirBypass
Set timer for device.
This may not be implemented for all devices. Please open an issue if there is an error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
Duration in seconds. |
required |
action
|
str | None
|
Action to take when timer expires. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_turbo_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Turbo Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
sleep_mode
async
deprecated
↲
to_dict ↲
Inherited From VeSyncBaseDevice
Return device information as a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in dictionary, defaults to True. |
True
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: Dictionary containing device information. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_json ↲
Inherited From VeSyncBaseDevice
Print JSON API string for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device details. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From VeSyncBaseDevice
JSON API bytes for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
JSON formatted bytes of device details. |
Example
This is an example without state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
toggle_child_lock
async
↲
Inherited From VeSyncAirBypass
Toggle Child Lock (Display Lock).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
Toggle child lock. If None, toggle state. |
None
|
Toggle child lock.
Set child lock to on or off. Internal method used by turn_on_child_lock
and
turn_off_child_lock
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool
|
True to turn child lock on, False to turn off |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if child lock is set, False if not |
Levoit 100S/200S set Child Lock.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool
|
True to turn child lock on, False to turn off |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False if not |
Source code in src\pyvesync\devices\vesyncpurifier.py
toggle_display
async
↲
Inherited From VeSyncAirBypass
Set Display Mode.
Source code in src\pyvesync\devices\vesyncpurifier.py
toggle_light_detection
async
↲
Inherited From VeSyncPurifier
Set Light Detection Mode.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
Toggle light detection. If None, toggle state. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Enable/Disable Light Detection Feature.
Source code in src\pyvesync\devices\vesyncpurifier.py
toggle_switch
async
↲
Inherited From VeSyncAirBypass
Toggle device power on or off.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
True to turn on, False to turn off, None to toggle. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
turbo_mode
async
deprecated
↲
turn_off
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device off.
turn_off_child_lock
async
↲
Inherited From VeSyncPurifier
Set child lock (display lock) to OFF.
turn_off_display
async
↲
Inherited From VeSyncPurifier
Turn off Display.
turn_off_light_detection
async
↲
Inherited From VeSyncPurifier
Turn off Light Detection.
turn_off_nightlight
async
↲
Inherited From VeSyncPurifier
Turn off Nightlight.
turn_on
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device on.
turn_on_child_lock
async
↲
Inherited From VeSyncPurifier
Set child lock (display lock) to ON.
turn_on_display
async
↲
Inherited From VeSyncPurifier
Turn on Display.
turn_on_light_detection
async
↲
Inherited From VeSyncPurifier
Turn on Light Detection.
turn_on_nightlight
async
↲
Inherited From VeSyncPurifier
Turn on Nightlight.
update
async
↲
Inherited From VeSyncBaseDevice
Update device details.
pyvesync.devices.vesyncpurifier.VeSyncAir131 ↲
Bases: BypassV1Mixin
, VeSyncPurifier
Levoit Air Purifier Class.
Class for LV-PUR131S, using BypassV1 API.
Attributes:
Name | Type | Description |
---|---|---|
state |
PurifierState
|
State of the device. |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
pid |
str
|
Product ID of device, pulled by some devices on update. |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
features |
dict
|
Features of device. |
modes |
list[str]
|
List of modes supported by the device. |
fan_levels |
list[int]
|
List of fan levels supported by the device. |
nightlight_modes |
list[str]
|
List of nightlight modes supported by the device. |
auto_preferences |
list[str]
|
List of auto preferences supported by the device. |
Source code in src\pyvesync\devices\vesyncpurifier.py
742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 |
|
Attributes↲
auto_preferences
instance-attribute
↲
Inherited From VeSyncPurifier
child_lock
property
↲
Inherited From VeSyncPurifier
Get child lock state.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if child lock is enabled, False if not. |
config_module
instance-attribute
↲
Inherited From VeSyncBaseDevice
connection_type
instance-attribute
↲
Inherited From VeSyncBaseDevice
current_firm_version
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_image
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_region
instance-attribute
↲
Inherited From VeSyncBaseDevice
firmware_update
property
↲
Inherited From VeSyncBaseDevice
Return True if firmware update available.
This is going to be updated.
last_response
instance-attribute
↲
last_response: ResponseInfo | None = None
Inherited From VeSyncBaseDevice
night_light
property
↲
Inherited From VeSyncPurifier
Get night light state.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Night light state (on, dim, off) |
nightlight_modes
instance-attribute
↲
Inherited From VeSyncPurifier
request_keys
class-attribute
↲
request_keys: list[str] = [
'acceptLanguage',
'appVersion',
'phoneBrand',
'phoneOS',
'accountID',
'cid',
'configModule',
'debugMode',
'traceId',
'timeZone',
'token',
'userCountryCode',
'uuid',
'configModel',
'deviceId',
]
Inherited From BypassV1Mixin
state
instance-attribute
↲
state: PurifierState = PurifierState(
self, details, feature_map
)
Inherited From VeSyncBaseDevice
sub_device_no
instance-attribute
↲
Inherited From VeSyncBaseDevice
supports_air_quality
property
↲
Inherited From VeSyncPurifier
Return True if device supports air quality.
supports_fan_rotate
property
↲
Inherited From VeSyncPurifier
Return True if device supports fan rotation.
supports_light_detection
property
↲
Inherited From VeSyncPurifier
Returns True if device supports light detection.
supports_nightlight
property
↲
Inherited From VeSyncPurifier
Return True if device supports nightlight.
Functions↲
auto_mode
async
deprecated
↲
call_bypassv1_api
async
↲
call_bypassv1_api(
request_model: type[RequestBypassV1],
update_dict: dict | None = None,
method: str = 'bypass',
endpoint: str = 'bypass',
) -> dict | None
Inherited From BypassV1Mixin
Send ByPass V1 API request.
This uses the _build_request
method to send API requests to the Bypass V1 API.
The endpoint can be overridden with the endpoint
argument.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request_model
|
type[RequestBypassV1]
|
The request model to use. |
required |
update_dict
|
dict
|
Additional keys to add on. |
None
|
method
|
str
|
The method to use in the outer body. |
'bypass'
|
endpoint
|
str | None
|
The last part of the url path, defaults to
|
'bypass'
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
dict | None
|
The response from the API request. |
Source code in src\pyvesync\utils\device_mixins.py
change_fan_speed
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use set_fan_speed()
instead.
Deprecated method for changing fan speed.
change_mode
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use set_mode(mode: str)
instead.
Deprecated method for changing purifier mode.
child_lock_off
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_off_child_lock()
instead.
Turn off child lock (display lock).
This has been deprecated, use turn_off_child_lock()
instead.
Source code in src\pyvesync\base_devices\purifier_base.py
child_lock_on
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_on_child_lock()
instead.
Turn on child lock (display lock).
This has been deprecated, use turn_on_child_lock()
instead.
Source code in src\pyvesync\base_devices\purifier_base.py
clear_timer
async
↲
Inherited From VeSyncBaseDevice
Clear timer for device from API.
This may not be implemented for all devices. Please open an issue if there is an error.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
display ↲
Inherited From VeSyncBaseDevice
Print formatted static device info to stdout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in display, defaults to True. |
True
|
Example:
Device Name:..................Living Room Lamp
Model:........................ESL100
Subdevice No:.................0
Type:.........................wifi
CID:..........................1234567890abcdef
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
displayJSON
deprecated
↲
Inherited From VeSyncBaseDevice
Deprecated
Use to_json() instead
Return JSON details for device. - Deprecated use to_json().
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
get_details
async
↲
Inherited From VeSyncBaseDevice
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state
attribute. The update()
method should
be called to update the device state.
Source code in src\pyvesync\devices\vesyncpurifier.py
get_state ↲
Inherited From VeSyncBaseDevice
Get device state attribute.
get_timer
async
↲
get_timer() -> Timer | None
Inherited From VeSyncBaseDevice
Get timer for device from API and set the state.Timer
attribute.
This may not be implemented for all devices. Please open an issue if there is an error.
Note
This method may not be implemented for all devices. Please open an issue if there is an error.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
manual_mode
async
deprecated
↲
nightlight_mode
async
deprecated
↲
pet_mode
async
deprecated
↲
reset_filter
async
↲
Inherited From VeSyncPurifier
Reset filter life.
set_auto_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Auto Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_auto_preference
async
↲
Inherited From VeSyncPurifier
Set auto preference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preference
|
str
|
Auto preference to set, available preference is
found in |
required |
room_size
|
int
|
Room size to set, defaults to 800ft2. |
800
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\purifier_base.py
set_child_lock
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use toggle_child_lock()
instead.
Set child lock (display lock).
This has been deprecated in favor of toggle_child_lock()
.
Source code in src\pyvesync\base_devices\purifier_base.py
set_fan_speed
async
↲
Inherited From VeSyncPurifier
Set Purifier Fan Speed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
speed
|
int | None
|
Fan speed to set. If None, use default speed. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_light_detection_off
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_off_light_detection() instead.
Turn off light detection feature.
set_light_detection_on
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_on_light_detection() instead.
Turn on light detection feature.
set_manual_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Manual Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier Mode.
Allowed modes are found in the device.modes
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
Mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
set_nightlight_dim
async
↲
Inherited From VeSyncPurifier
Set Nightlight Dim.
set_nightlight_mode
async
↲
Inherited From VeSyncPurifier
Set Nightlight Mode.
Modes are defined in the device.nightlight_modes
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
Nightlight mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\purifier_base.py
set_pet_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Pet Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_sleep_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Sleep Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_state ↲
Inherited From VeSyncBaseDevice
Set device state attribute.
set_timer
async
↲
Inherited From VeSyncBaseDevice
Set timer for device.
This may not be implemented for all devices. Please open an issue if there is an error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
Duration in seconds. |
required |
action
|
str | None
|
Action to take when timer expires. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
set_turbo_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Turbo Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
sleep_mode
async
deprecated
↲
to_dict ↲
Inherited From VeSyncBaseDevice
Return device information as a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in dictionary, defaults to True. |
True
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: Dictionary containing device information. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_json ↲
Inherited From VeSyncBaseDevice
Print JSON API string for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device details. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From VeSyncBaseDevice
JSON API bytes for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
JSON formatted bytes of device details. |
Example
This is an example without state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
toggle_child_lock
async
↲
Inherited From VeSyncPurifier
Toggle Child Lock (Display Lock).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
Toggle child lock. If None, toggle state. |
None
|
Source code in src\pyvesync\base_devices\purifier_base.py
toggle_display
async
↲
Inherited From VeSyncPurifier
Set Display Mode.
Source code in src\pyvesync\devices\vesyncpurifier.py
toggle_light_detection
async
↲
Inherited From VeSyncPurifier
Set Light Detection Mode.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
Toggle light detection. If None, toggle state. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\purifier_base.py
toggle_switch
async
↲
Inherited From VeSyncBaseToggleDevice
Toggle device power on or off.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
True to turn on, False to turn off, None to toggle. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncpurifier.py
turbo_mode
async
deprecated
↲
turn_off
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device off.
turn_off_child_lock
async
↲
Inherited From VeSyncPurifier
Set child lock (display lock) to OFF.
turn_off_display
async
↲
Inherited From VeSyncPurifier
Turn off Display.
turn_off_light_detection
async
↲
Inherited From VeSyncPurifier
Turn off Light Detection.
turn_off_nightlight
async
↲
Inherited From VeSyncPurifier
Turn off Nightlight.
turn_on
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device on.
turn_on_child_lock
async
↲
Inherited From VeSyncPurifier
Set child lock (display lock) to ON.
turn_on_display
async
↲
Inherited From VeSyncPurifier
Turn on Display.
turn_on_light_detection
async
↲
Inherited From VeSyncPurifier
Turn on Light Detection.
turn_on_nightlight
async
↲
Inherited From VeSyncPurifier
Turn on Nightlight.
update
async
↲
Inherited From VeSyncBaseDevice
Update device details.
pyvesync.base_devices.purifier_base.VeSyncPurifier ↲
Bases: VeSyncBaseToggleDevice
Base device for vesync air purifiers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
details
|
ResponseDeviceDetailsModel
|
Device details from API. |
required |
manager
|
VeSync
|
VeSync manager instance. |
required |
feature_map
|
PurifierMap
|
Feature map for the device. |
required |
Attributes:
Name | Type | Description |
---|---|---|
state |
PurifierState
|
State of the device. |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
pid |
str
|
Product ID of device, pulled by some devices on update. |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
features |
dict
|
Features of device. |
modes |
list[str]
|
List of modes supported by the device. |
fan_levels |
list[int]
|
List of fan levels supported by the device. |
nightlight_modes |
list[str]
|
List of nightlight modes supported by the device. |
auto_preferences |
list[str]
|
List of auto preferences supported by the device. |
Source code in src\pyvesync\base_devices\purifier_base.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
|
Attributes↲
auto_preferences
instance-attribute
↲
Inherited From VeSyncPurifier
child_lock
property
↲
Inherited From VeSyncPurifier
Get child lock state.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if child lock is enabled, False if not. |
config_module
instance-attribute
↲
Inherited From VeSyncBaseDevice
connection_type
instance-attribute
↲
Inherited From VeSyncBaseDevice
current_firm_version
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_image
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_region
instance-attribute
↲
Inherited From VeSyncBaseDevice
firmware_update
property
↲
Inherited From VeSyncBaseDevice
Return True if firmware update available.
This is going to be updated.
last_response
instance-attribute
↲
last_response: ResponseInfo | None = None
Inherited From VeSyncBaseDevice
night_light
property
↲
Inherited From VeSyncPurifier
Get night light state.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Night light state (on, dim, off) |
nightlight_modes
instance-attribute
↲
Inherited From VeSyncPurifier
state
instance-attribute
↲
state: PurifierState = PurifierState(
self, details, feature_map
)
Inherited From VeSyncBaseDevice
sub_device_no
instance-attribute
↲
Inherited From VeSyncBaseDevice
supports_air_quality
property
↲
Inherited From VeSyncPurifier
Return True if device supports air quality.
supports_fan_rotate
property
↲
Inherited From VeSyncPurifier
Return True if device supports fan rotation.
supports_light_detection
property
↲
Inherited From VeSyncPurifier
Returns True if device supports light detection.
supports_nightlight
property
↲
Inherited From VeSyncPurifier
Return True if device supports nightlight.
Functions↲
auto_mode
async
deprecated
↲
change_fan_speed
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use set_fan_speed()
instead.
Deprecated method for changing fan speed.
change_mode
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use set_mode(mode: str)
instead.
Deprecated method for changing purifier mode.
child_lock_off
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_off_child_lock()
instead.
Turn off child lock (display lock).
This has been deprecated, use turn_off_child_lock()
instead.
Source code in src\pyvesync\base_devices\purifier_base.py
child_lock_on
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_on_child_lock()
instead.
Turn on child lock (display lock).
This has been deprecated, use turn_on_child_lock()
instead.
Source code in src\pyvesync\base_devices\purifier_base.py
clear_timer
async
↲
Inherited From VeSyncBaseDevice
Clear timer for device from API.
This may not be implemented for all devices. Please open an issue if there is an error.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
display ↲
Inherited From VeSyncBaseDevice
Print formatted static device info to stdout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in display, defaults to True. |
True
|
Example:
Device Name:..................Living Room Lamp
Model:........................ESL100
Subdevice No:.................0
Type:.........................wifi
CID:..........................1234567890abcdef
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
displayJSON
deprecated
↲
Inherited From VeSyncBaseDevice
Deprecated
Use to_json() instead
Return JSON details for device. - Deprecated use to_json().
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
get_details
abstractmethod
async
↲
Inherited From VeSyncBaseDevice
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state
attribute. The update()
method should
be called to update the device state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
get_state ↲
Inherited From VeSyncBaseDevice
Get device state attribute.
get_timer
async
↲
get_timer() -> Timer | None
Inherited From VeSyncBaseDevice
Get timer for device from API and set the state.Timer
attribute.
This may not be implemented for all devices. Please open an issue if there is an error.
Note
This method may not be implemented for all devices. Please open an issue if there is an error.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
manual_mode
async
deprecated
↲
nightlight_mode
async
deprecated
↲
pet_mode
async
deprecated
↲
reset_filter
async
↲
Inherited From VeSyncPurifier
Reset filter life.
set_auto_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Auto Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_auto_preference
async
↲
Inherited From VeSyncPurifier
Set auto preference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preference
|
str
|
Auto preference to set, available preference is
found in |
required |
room_size
|
int
|
Room size to set, defaults to 800ft2. |
800
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\purifier_base.py
set_child_lock
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use toggle_child_lock()
instead.
Set child lock (display lock).
This has been deprecated in favor of toggle_child_lock()
.
Source code in src\pyvesync\base_devices\purifier_base.py
set_fan_speed
abstractmethod
async
↲
Set Purifier Fan Speed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
speed
|
int | None
|
Fan speed to set. If None, use default speed. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\purifier_base.py
set_light_detection_off
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_off_light_detection() instead.
Turn off light detection feature.
set_light_detection_on
async
deprecated
↲
Inherited From VeSyncPurifier
Deprecated
Use turn_on_light_detection() instead.
Turn on light detection feature.
set_manual_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Manual Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_mode
abstractmethod
async
↲
Set Purifier Mode.
Allowed modes are found in the device.modes
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
Mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\purifier_base.py
set_nightlight_dim
async
↲
Inherited From VeSyncPurifier
Set Nightlight Dim.
set_nightlight_mode
async
↲
Inherited From VeSyncPurifier
Set Nightlight Mode.
Modes are defined in the device.nightlight_modes
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
Nightlight mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\purifier_base.py
set_pet_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Pet Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_sleep_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Sleep Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
set_state ↲
Inherited From VeSyncBaseDevice
Set device state attribute.
set_timer
async
↲
Inherited From VeSyncBaseDevice
Set timer for device.
This may not be implemented for all devices. Please open an issue if there is an error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
Duration in seconds. |
required |
action
|
str | None
|
Action to take when timer expires. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
set_turbo_mode
async
↲
Inherited From VeSyncPurifier
Set Purifier to Turbo Mode.
Source code in src\pyvesync\base_devices\purifier_base.py
sleep_mode
async
deprecated
↲
to_dict ↲
Inherited From VeSyncBaseDevice
Return device information as a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in dictionary, defaults to True. |
True
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: Dictionary containing device information. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_json ↲
Inherited From VeSyncBaseDevice
Print JSON API string for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device details. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From VeSyncBaseDevice
JSON API bytes for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
JSON formatted bytes of device details. |
Example
This is an example without state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
toggle_child_lock
async
↲
Inherited From VeSyncPurifier
Toggle Child Lock (Display Lock).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
Toggle child lock. If None, toggle state. |
None
|
Source code in src\pyvesync\base_devices\purifier_base.py
toggle_display
async
↲
toggle_light_detection
async
↲
Inherited From VeSyncPurifier
Set Light Detection Mode.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
Toggle light detection. If None, toggle state. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\purifier_base.py
toggle_switch
abstractmethod
async
↲
Inherited From VeSyncBaseToggleDevice
Toggle device power on or off.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
True to turn on, False to turn off, None to toggle. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
turbo_mode
async
deprecated
↲
turn_off
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device off.
turn_off_child_lock
async
↲
Inherited From VeSyncPurifier
Set child lock (display lock) to OFF.
turn_off_display
async
↲
Inherited From VeSyncPurifier
Turn off Display.
turn_off_light_detection
async
↲
Inherited From VeSyncPurifier
Turn off Light Detection.
turn_off_nightlight
async
↲
Inherited From VeSyncPurifier
Turn off Nightlight.
turn_on
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device on.
turn_on_child_lock
async
↲
Inherited From VeSyncPurifier
Set child lock (display lock) to ON.
turn_on_display
async
↲
Inherited From VeSyncPurifier
Turn on Display.
turn_on_light_detection
async
↲
Inherited From VeSyncPurifier
Turn on Light Detection.
turn_on_nightlight
async
↲
Inherited From VeSyncPurifier
Turn on Nightlight.
update
async
↲
Inherited From VeSyncBaseDevice
Update device details.