VeSync Constants↲
pyvesync.const ↲
pyvesync library constants.
All device states and information are defined by Enums in this module.
Attributes:
Name | Type | Description |
---|---|---|
DEFAULT_LANGUAGE |
str
|
Default language for the VeSync app. |
API_BASE_URL |
str
|
Base URL for the VeSync API. |
API_TIMEOUT |
int
|
Timeout for API requests. |
USER_AGENT |
str
|
User agent for API requests. |
DEFAULT_TZ |
str
|
Default timezone for VeSync devices, updated by API after login. |
DEFAULT_REGION |
str
|
Default region for VeSync devices, updated by API when retrieving devices. |
APP_VERSION |
str
|
Version of the VeSync app. |
PHONE_BRAND |
str
|
Brand of the phone used to login to the VeSync app. |
PHONE_OS |
str
|
Operating system of the phone used to login to the VeSync app. |
MOBILE_ID |
str
|
Unique identifier for the phone used to login to the VeSync app. |
USER_TYPE |
str
|
User type for the VeSync app - internal app usage. |
BYPASS_APP_V |
str
|
Bypass app version |
BYPASS_HEADER_UA |
str
|
Bypass header user agent |
TERMINAL_ID |
str
|
Unique identifier for new API calls |
USER_AGENT
module-attribute
↲
AIRFRYER_PID_MAP
module-attribute
↲
AIRFRYER_PID_MAP = {
'WiFi_SKA_AirFryer137_US': 'wnxwqs76gknqyzjn',
'WiFi_SKA_AirFryer158_US': '2cl8hmafsthl65bd',
'WiFi_AirFryer_CS158-AF_EU': '8t8op7pcvzlsbosm',
}
PID's for VeSync Air Fryers based on ConfigModule.
IntEnumMixin ↲
Bases: IntEnum
Mixin class to handle missing enum values.
Adds missing method using the extend_enum
function to
return a new enum member with the name "UNKNOWN" and the
missing value.
Source code in src\pyvesync\utils\enum_utils.py
_missing_
classmethod
↲
Inherited From IntEnumMixin
Handle missing enum values by returning member with UNKNOWN name.
Source code in src\pyvesync\utils\enum_utils.py
ProductTypes ↲
Bases: StrEnum
General device types enum.
Source code in src\pyvesync\const.py
IntFlag ↲
Bases: IntEnum
Integer flag to indicate if a device is not supported.
This is used by data models as a default value for feature attributes that are not supported by all devices.
The default value is -999.
Attributes:
Name | Type | Description |
---|---|---|
NOT_SUPPORTED |
Device is not supported, -999 |
Source code in src\pyvesync\const.py
StrFlag ↲
Bases: StrEnum
String flag to indicate if a device is not supported.
This is used by data models as a default value for feature attributes that are not supported by all devices.
The default value is "not_supported".
Attributes:
Name | Type | Description |
---|---|---|
NOT_SUPPORTED |
Device is not supported, "not_supported" |
Source code in src\pyvesync\const.py
NightlightStatus ↲
Bases: StrEnum
Nightlight status for VeSync devices.
Values can be converted to int and bool.
Attributes:
Name | Type | Description |
---|---|---|
ON |
Nightlight is on. |
|
OFF |
Nightlight is off. |
|
AUTO |
Nightlight is in auto mode. |
|
UNKNOWN |
Nightlight status is unknown. |
Usage
Source code in src\pyvesync\const.py
DeviceStatus ↲
Bases: StrEnum
VeSync device status enum.
In addition to converting to int and bool values, this enum can be used to convert from bool and int values to corresponding string values.
Attributes:
Name | Type | Description |
---|---|---|
ON |
Device is on. |
|
OFF |
Device is off. |
|
PAUSED |
Device is paused. |
|
STANDBY |
Device is in standby mode. |
|
IDLE |
Device is idle. |
|
RUNNING |
Device is running. |
|
UNKNOWN |
Device status is unknown. |
Usage
Source code in src\pyvesync\const.py
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 |
|
__bool__ ↲
__int__ ↲
Return integer representation of the enum.
1 is ON and RUNNING, 0 is OFF, PAUSED, STANDBY, IDLE. -1 is UNKNOWN.
Source code in src\pyvesync\const.py
from_int
classmethod
↲
Convert integer value to corresponding string.
If value is 1, return ON and if 0, return OFF. If value is -999, return NOT_SUPPORTED.
Source code in src\pyvesync\const.py
from_bool
classmethod
↲
from_bool(value: bool) -> DeviceStatus
ConnectionStatus ↲
Bases: StrEnum
VeSync device connection status enum.
Corresponding boolean value is True if device is online.
Attributes:
Name | Type | Description |
---|---|---|
ONLINE |
Device is online. |
|
OFFLINE |
Device is offline. |
|
UNKNOWN |
Device connection status is unknown. |
Methods:
Name | Description |
---|---|
from_bool |
bool | None) -> ConnectionStatus: Convert boolean value to corresponding string. |
Usage
Source code in src\pyvesync\const.py
__bool__ ↲
from_bool
classmethod
↲
from_bool(value: bool | None) -> ConnectionStatus
Convert boolean value to corresponding string.
Returns ConnectionStatus.ONLINE if True, else ConnectionStatus.OFFLINE.
Source code in src\pyvesync\const.py
NightlightModes ↲
Bases: StrEnum
Nightlight modes.
Attributes:
Name | Type | Description |
---|---|---|
ON |
Nightlight is on. |
|
OFF |
Nightlight is off. |
|
DIM |
Nightlight is dimmed. |
|
AUTO |
Nightlight is in auto mode. |
|
UNKNOWN |
Nightlight status is unknown. |
Source code in src\pyvesync\const.py
__bool__ ↲
Return True if nightlight is on or auto.
Off and unknown are False, all other True.
ColorMode ↲
Bases: StrEnum
VeSync bulb color modes.
Attributes:
Name | Type | Description |
---|---|---|
RGB |
RGB color mode. |
|
HSV |
HSV color mode. |
|
WHITE |
White color mode. |
|
COLOR |
Color mode. |
Source code in src\pyvesync\const.py
AirQualityLevel ↲
Bases: Enum
Representation of air quality levels as string and integers.
Attributes:
Name | Type | Description |
---|---|---|
EXCELLENT |
Air quality is excellent. |
|
GOOD |
Air quality is good. |
|
MODERATE |
Air quality is moderate. |
|
POOR |
Air quality is poor. |
|
UNKNOWN |
Air quality is unknown. |
Methods:
Name | Description |
---|---|
from_string |
str | None) -> AirQualityLevel: Convert string value to corresponding integer. |
from_int |
int | None) -> AirQualityLevel: Convert integer value to corresponding string. |
Note
Alias for "very good" is "excellent". Alias for "bad" is "poor".
Usage
AirQualityLevels.EXCELLENT
# <AirQualityLevels.EXCELLENT: 1>
AirQualityLevels.from_string("excellent")
# 1
AirQualityLevels.from_int(1)
# "excellent"
int(AirQualityLevels.EXCELLENT)
# 1
str(AirQualityLevels.EXCELLENT)
# "excellent"
from_string("good")
# <AirQualityLevels.GOOD: 2>
from_int(2)
# "good"
Source code in src\pyvesync\const.py
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 |
|
__int__ ↲
__str__ ↲
from_string
classmethod
↲
from_string(value: str | None) -> AirQualityLevel
Convert string value to corresponding integer.
Get enum from string value to normalize different values of the same format.
Note
Values are excellent, good, moderate and poor. Aliases are: very good for excellent and bad for poor. Unknown is returned if value is None or not in the list.
Source code in src\pyvesync\const.py
from_int
classmethod
↲
from_int(value: int | None) -> AirQualityLevel
Convert integer value to corresponding string.
PurifierAutoPreference ↲
Bases: StrEnum
Preference Levels for Purifier Auto Mode.
Attributes:
Name | Type | Description |
---|---|---|
DEFAULT |
Default preference level. |
|
EFFICIENT |
Efficient preference level. |
|
QUIET |
Quiet preference level. |
|
UNKNOWN |
Unknown preference level. |
Source code in src\pyvesync\const.py
FanSleepPreference ↲
Bases: StrEnum
Sleep mode preferences for VeSync fans.
Attributes:
Name | Type | Description |
---|---|---|
DEFAULT |
Default sleep mode. |
|
ADVANCED |
Advanced sleep mode. |
|
TURBO |
Turbo sleep mode. |
|
EFFICIENT |
Efficient sleep mode. |
|
QUIET |
Quiet sleep mode. |
|
UNKNOWN |
Unknown sleep mode. |
Source code in src\pyvesync\const.py
Features ↲
HumidifierFeatures ↲
Bases: Features
VeSync humidifier features.
Attributes:
Name | Type | Description |
---|---|---|
ONOFF |
Device on/off status. |
|
CHILD_LOCK |
Child lock status. |
|
NIGHTLIGHT |
Nightlight status. |
|
WATER_LEVEL |
Water level status. |
|
WARM_MIST |
Warm mist status. |
|
AUTO_STOP |
Auto stop when target humidity is reached. Different from auto, which adjusts fan level to maintain humidity. |
Source code in src\pyvesync\const.py
PurifierFeatures ↲
Bases: Features
VeSync air purifier features.
Attributes:
Name | Type | Description |
---|---|---|
CHILD_LOCK |
Child lock status. |
|
NIGHTLIGHT |
Nightlight status. |
|
AIR_QUALITY |
Air quality status. |
|
VENT_ANGLE |
Vent angle status. |
|
LIGHT_DETECT |
Light detection status. |
|
PM25 |
PM2.5 level status. |
|
PM10 |
PM10 level status. |
|
PM1 |
PM1 level status. |
|
AQPERCENT |
Air quality percentage status. |
|
RESET_FILTER |
Reset filter status. |
Source code in src\pyvesync\const.py
PurifierStringLevels ↲
Bases: Features
String levels for Air Purifier fan speed.
Attributes:
Name | Type | Description |
---|---|---|
LOW |
Low fan speed. |
|
MEDIUM |
Medium fan speed. |
|
HIGH |
High fan speed. |
Source code in src\pyvesync\const.py
BulbFeatures ↲
Bases: Features
VeSync bulb features.
Attributes:
Name | Type | Description |
---|---|---|
ONOFF |
Device on/off status. |
|
DIMMABLE |
Dimmable status. |
|
COLOR_TEMP |
Color temperature status. |
|
MULTICOLOR |
Multicolor status. |
Source code in src\pyvesync\const.py
OutletFeatures ↲
Bases: Features
VeSync outlet features.
Attributes:
Name | Type | Description |
---|---|---|
ONOFF |
Device on/off status. |
|
ENERGY_MONITOR |
Energy monitor status. |
|
NIGHTLIGHT |
Nightlight status. |
Source code in src\pyvesync\const.py
SwitchFeatures ↲
Bases: Features
VeSync switch features.
Attributes:
Name | Type | Description |
---|---|---|
ONOFF |
Device on/off status. |
|
DIMMABLE |
Dimmable status. |
|
INDICATOR_LIGHT |
Indicator light status. |
|
BACKLIGHT |
Backlight status. |
|
BACKLIGHT_RGB |
RGB backlight status. |
Source code in src\pyvesync\const.py
FanFeatures ↲
PurifierModes ↲
Bases: Features
VeSync air purifier modes.
Attributes:
Name | Type | Description |
---|---|---|
AUTO |
Auto mode. |
|
MANUAL |
Manual mode. |
|
SLEEP |
Sleep mode. |
|
TURBO |
Turbo mode. |
|
PET |
Pet mode. |
|
UNKNOWN |
Unknown mode. |
Source code in src\pyvesync\const.py
HumidifierModes ↲
Bases: Features
VeSync humidifier modes.
Attributes:
Name | Type | Description |
---|---|---|
AUTO |
Auto mode. |
|
MANUAL |
Manual mode. |
|
HUMIDITY |
Humidity mode. |
|
SLEEP |
Sleep mode. |
|
TURBO |
Turbo mode. |
|
PET |
Pet mode. |
|
UNKNOWN |
Unknown mode. |
|
AUTOPRO |
AutoPro mode. |
Source code in src\pyvesync\const.py
FanModes ↲
Bases: StrEnum
VeSync fan modes.
Attributes:
Name | Type | Description |
---|---|---|
AUTO |
Auto mode. |
|
NORMAL |
Normal mode. |
|
MANUAL |
Manual mode. |
|
SLEEP |
Sleep mode. |
|
TURBO |
Turbo mode. |
|
PET |
Pet mode. |
|
UNKNOWN |
Unknown mode. |
|
ADVANCED_SLEEP |
Advanced sleep mode. |
Source code in src\pyvesync\const.py
ThermostatWorkModes ↲
Bases: IntEnum
Working modes for VeSync Aura thermostats.
Based on the VeSync app and API values.
Attributes:
Name | Type | Description |
---|---|---|
OFF |
Thermostat is off (0). |
|
HEAT |
Thermostat is in heating mode (1). |
|
COOL |
Thermostat is in cooling mode (2). |
|
AUTO |
Thermostat is in auto mode (3). |
|
EM_HEAT |
Thermostat is in emergency heating mode (4). |
|
SMART_AUTO |
Thermostat is in smart auto mode (5). |
Source code in src\pyvesync\const.py
ThermostatFanModes ↲
Bases: IntEnum
Fan modes for VeSync Aura thermostats.
Based on the VeSync app and API values.
Attributes:
Name | Type | Description |
---|---|---|
AUTO |
Fan is in auto mode (1). |
|
ON |
Fan is on (2). |
|
CIRCULATE |
Fan is in circulate mode (3). |
Source code in src\pyvesync\const.py
ThermostatHoldOptions ↲
Bases: IntEnumMixin
Hold options for VeSync Aura thermostats.
Attributes:
Name | Type | Description |
---|---|---|
UNTIL_NEXT_SCHEDULED_ITEM |
Hold until next scheduled item (2). |
|
TWO_HOURS |
Hold for two hours (3). |
|
FOUR_HOURS |
Hold for four hours (4). |
|
PERMANENTLY |
Hold permanently (5). |
Source code in src\pyvesync\const.py
ThermostatHoldStatus ↲
Bases: IntEnumMixin
Set the hold status of the thermostat.
Attributes:
Name | Type | Description |
---|---|---|
SET |
Set the hold status (1). |
|
CANCEL |
Cancel the hold status (0). |
Source code in src\pyvesync\const.py
ThermostatScheduleOrHoldOptions ↲
Bases: IntEnumMixin
Schedule or hold options for VeSync Aura thermostats.
Source code in src\pyvesync\const.py
ThermostatEcoTypes ↲
ThermostatRoutineTypes ↲
ThermostatAlarmCodes ↲
ThermostatReminderCodes ↲
Bases: IntEnumMixin
Reminder codes for VeSync Aura thermostats.
Source code in src\pyvesync\const.py
ThermostatWorkStatusCodes ↲
ThermostatFanStatus ↲
ThermostatConst ↲
Constants for VeSync Aura thermostats.