Skip to content

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

DEFAULT_LANGUAGE module-attribute

DEFAULT_LANGUAGE = 'en'

API_BASE_URL module-attribute

API_BASE_URL = 'https://smartapi.vesync.com'

API_TIMEOUT module-attribute

API_TIMEOUT = 8

USER_AGENT module-attribute

USER_AGENT = 'VeSync/3.2.39 (com.etekcity.vesyncPlatform; build:5; iOS 15.5.0) Alamofire/5.2.1'

DEFAULT_TZ module-attribute

DEFAULT_TZ = 'America/New_York'

DEFAULT_REGION module-attribute

DEFAULT_REGION = 'US'

APP_VERSION module-attribute

APP_VERSION = '2.8.6'

PHONE_BRAND module-attribute

PHONE_BRAND = 'SM N9005'

PHONE_OS module-attribute

PHONE_OS = 'Android'

MOBILE_ID module-attribute

MOBILE_ID = str(randint(1000000000000000, 9999999999999999))

USER_TYPE module-attribute

USER_TYPE = '1'

BYPASS_APP_V module-attribute

BYPASS_APP_V = 'VeSync 3.0.51'

BYPASS_HEADER_UA module-attribute

BYPASS_HEADER_UA = 'okhttp/3.12.1'

TERMINAL_ID module-attribute

TERMINAL_ID = '2' + hex

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
class IntEnumMixin(enum.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.
    """

    @classmethod
    def _missing_(cls: type[enum.IntEnum], value: object) -> enum.IntEnum:
        """Handle missing enum values by returning member with UNKNOWN name."""
        for member in cls:
            if member.value == value:
                return member
        unknown_enum_val = int.__new__(cls, value)  # type: ignore[call-overload]
        unknown_enum_val._name_ = "UNKNOWN"
        unknown_enum_val._value_ = value  # type: ignore[assignment]
        unknown_enum_val.__objclass__ = cls.__class__  # type: ignore[assignment]
        return unknown_enum_val

_missing_ classmethod

_missing_(value: object) -> IntEnum

Inherited From IntEnumMixin

Handle missing enum values by returning member with UNKNOWN name.

Source code in src\pyvesync\utils\enum_utils.py
@classmethod
def _missing_(cls: type[enum.IntEnum], value: object) -> enum.IntEnum:
    """Handle missing enum values by returning member with UNKNOWN name."""
    for member in cls:
        if member.value == value:
            return member
    unknown_enum_val = int.__new__(cls, value)  # type: ignore[call-overload]
    unknown_enum_val._name_ = "UNKNOWN"
    unknown_enum_val._value_ = value  # type: ignore[assignment]
    unknown_enum_val.__objclass__ = cls.__class__  # type: ignore[assignment]
    return unknown_enum_val

ProductTypes

Bases: StrEnum

General device types enum.

Source code in src\pyvesync\const.py
class ProductTypes(StrEnum):
    """General device types enum."""
    OUTLET = "Outlet"
    BULB = "Bulb"
    SWITCH = "Switch"
    PURIFIER = "Purifier"
    FAN = "Fan"
    HUMIDIFIER = "Humidifier"
    AIR_FRYER = "Air Fryer"
    KITCHEN_THERMOMETER = "Kitchen Thermometer"
    THERMOSTAT = "Thermostat"

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
class IntFlag(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:
        NOT_SUPPORTED: Device is not supported, -999
    """
    NOT_SUPPORTED = -999

    def __str__(self) -> str:
        """Return string representation of IntFlag."""
        return str(self.name)

__str__

__str__() -> str

Return string representation of IntFlag.

Source code in src\pyvesync\const.py
def __str__(self) -> str:
    """Return string representation of IntFlag."""
    return str(self.name)

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
class StrFlag(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:
        NOT_SUPPORTED: Device is not supported, "not_supported"
    """
    NOT_SUPPORTED = "not_supported"

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
NightlightStatus.ON
# <NightlightStatus.ON: 'on'>
int(NightlightStatus.ON)
# 1
bool(NightlightStatus.ON)
# True
Source code in src\pyvesync\const.py
class NightlightStatus(StrEnum):
    """Nightlight status for VeSync devices.

    Values can be converted to int and bool.

    Attributes:
        ON: Nightlight is on.
        OFF: Nightlight is off.
        AUTO: Nightlight is in auto mode.
        UNKNOWN: Nightlight status is unknown.

    Usage:
        ```python
        NightlightStatus.ON
        # <NightlightStatus.ON: 'on'>
        int(NightlightStatus.ON)
        # 1
        bool(NightlightStatus.ON)
        # True
        ```
    """
    ON = "on"
    OFF = "off"
    AUTO = "auto"
    UNKNOWN = "unknown"

    def __bool__(self) -> bool:
        """Return True if nightlight is on or auto."""
        return self in [NightlightStatus.ON, NightlightStatus.AUTO]

    def __int__(self) -> int:
        """Return integer representation of the enum."""
        if self not in [NightlightStatus.ON, NightlightStatus.OFF]:
            raise ValueError("Only ON and OFF are valid values for int conversion")
        return int(self == NightlightStatus.ON)

__bool__

__bool__() -> bool

Return True if nightlight is on or auto.

Source code in src\pyvesync\const.py
def __bool__(self) -> bool:
    """Return True if nightlight is on or auto."""
    return self in [NightlightStatus.ON, NightlightStatus.AUTO]

__int__

__int__() -> int

Return integer representation of the enum.

Source code in src\pyvesync\const.py
def __int__(self) -> int:
    """Return integer representation of the enum."""
    if self not in [NightlightStatus.ON, NightlightStatus.OFF]:
        raise ValueError("Only ON and OFF are valid values for int conversion")
    return int(self == NightlightStatus.ON)

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
DeviceStatus.ON
# <DeviceStatus.ON: 'on'>
bool(DeviceStatus.ON)
# True
int(DeviceStatus.ON)
# 1
DeviceStatus.from_int(1)
# 'on'
DeviceStatus.from_bool(True)
# 'on'
Source code in src\pyvesync\const.py
class DeviceStatus(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:
        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:
        ```python
        DeviceStatus.ON
        # <DeviceStatus.ON: 'on'>
        bool(DeviceStatus.ON)
        # True
        int(DeviceStatus.ON)
        # 1
        DeviceStatus.from_int(1)
        # 'on'
        DeviceStatus.from_bool(True)
        # 'on'
        ```
    """
    ON = "on"
    OFF = "off"
    PAUSED = "paused"
    STANDBY = "standby"
    IDLE = "idle"
    RUNNING = "running"
    UNKNOWN = "unknown"

    def __bool__(self) -> bool:
        """Return True if device is on or running."""
        return self in [DeviceStatus.ON, DeviceStatus.RUNNING]

    def __int__(self) -> int:
        """Return integer representation of the enum.

        1 is ON and RUNNING, 0 is OFF, PAUSED, STANDBY, IDLE.
        -1 is UNKNOWN.
        """
        match self:
            case DeviceStatus.ON | DeviceStatus.RUNNING:
                return 1
            case (
                DeviceStatus.OFF
                | DeviceStatus.PAUSED
                | DeviceStatus.STANDBY
                | DeviceStatus.IDLE
            ):
                return 0
        return -1

    @classmethod
    def from_int(cls, value: int) -> str:
        """Convert integer value to corresponding string.

        If value is 1, return ON and if 0, return OFF.
        If value is -999, return NOT_SUPPORTED.
        """
        if value == 1:
            return cls.ON
        if value == 0:
            return cls.OFF
        if value == IntFlag.NOT_SUPPORTED:
            return StrFlag.NOT_SUPPORTED
        return cls.UNKNOWN

    @classmethod
    def from_bool(cls, value: bool) -> 'DeviceStatus':
        """Convert boolean value to corresponding string."""
        return cls.ON if value else cls.OFF

__bool__

__bool__() -> bool

Return True if device is on or running.

Source code in src\pyvesync\const.py
def __bool__(self) -> bool:
    """Return True if device is on or running."""
    return self in [DeviceStatus.ON, DeviceStatus.RUNNING]

__int__

__int__() -> 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
def __int__(self) -> int:
    """Return integer representation of the enum.

    1 is ON and RUNNING, 0 is OFF, PAUSED, STANDBY, IDLE.
    -1 is UNKNOWN.
    """
    match self:
        case DeviceStatus.ON | DeviceStatus.RUNNING:
            return 1
        case (
            DeviceStatus.OFF
            | DeviceStatus.PAUSED
            | DeviceStatus.STANDBY
            | DeviceStatus.IDLE
        ):
            return 0
    return -1

from_int classmethod

from_int(value: int) -> str

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
@classmethod
def from_int(cls, value: int) -> str:
    """Convert integer value to corresponding string.

    If value is 1, return ON and if 0, return OFF.
    If value is -999, return NOT_SUPPORTED.
    """
    if value == 1:
        return cls.ON
    if value == 0:
        return cls.OFF
    if value == IntFlag.NOT_SUPPORTED:
        return StrFlag.NOT_SUPPORTED
    return cls.UNKNOWN

from_bool classmethod

from_bool(value: bool) -> DeviceStatus

Convert boolean value to corresponding string.

Source code in src\pyvesync\const.py
@classmethod
def from_bool(cls, value: bool) -> 'DeviceStatus':
    """Convert boolean value to corresponding string."""
    return cls.ON if value else cls.OFF

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
ConnectionStatus.ONLINE
# <ConnectionStatus.ONLINE: 'online'>
bool(ConnectionStatus.ONLINE)
# True
ConnectionStatus.ONLINE == ConnectionStatus.ONLINE
# True
Source code in src\pyvesync\const.py
class ConnectionStatus(StrEnum):
    """VeSync device connection status enum.

    Corresponding boolean value is True if device is online.

    Attributes:
        ONLINE: Device is online.
        OFFLINE: Device is offline.
        UNKNOWN: Device connection status is unknown.

    Methods:
        from_bool(value: bool | None) -> ConnectionStatus:
            Convert boolean value to corresponding string.

    Usage:
        ```python
        ConnectionStatus.ONLINE
        # <ConnectionStatus.ONLINE: 'online'>
        bool(ConnectionStatus.ONLINE)
        # True
        ConnectionStatus.ONLINE == ConnectionStatus.ONLINE
        # True
        ```
    """
    ONLINE = "online"
    OFFLINE = "offline"
    UNKNOWN = "unknown"

    def __bool__(self) -> bool:
        """Return True if device is online."""
        return self == ConnectionStatus.ONLINE

    @classmethod
    def from_bool(cls, value: bool | None) -> 'ConnectionStatus':
        """Convert boolean value to corresponding string.

        Returns ConnectionStatus.ONLINE if True, else ConnectionStatus.OFFLINE.
        """
        return cls.ONLINE if value else cls.OFFLINE

__bool__

__bool__() -> bool

Return True if device is online.

Source code in src\pyvesync\const.py
def __bool__(self) -> bool:
    """Return True if device is online."""
    return self == ConnectionStatus.ONLINE

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
@classmethod
def from_bool(cls, value: bool | None) -> 'ConnectionStatus':
    """Convert boolean value to corresponding string.

    Returns ConnectionStatus.ONLINE if True, else ConnectionStatus.OFFLINE.
    """
    return cls.ONLINE if value else cls.OFFLINE

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
class NightlightModes(StrEnum):
    """Nightlight modes.

    Attributes:
        ON: Nightlight is on.
        OFF: Nightlight is off.
        DIM: Nightlight is dimmed.
        AUTO: Nightlight is in auto mode.
        UNKNOWN: Nightlight status is unknown.
    """
    ON = "on"
    OFF = "off"
    DIM = "dim"
    AUTO = "auto"
    UNKNOWN = "unknown"

    def __bool__(self) -> bool:
        """Return True if nightlight is on or auto.

        Off and unknown are False, all other True.
        """
        return self in [
            NightlightModes.ON, NightlightModes.AUTO, NightlightModes.DIM
            ]

__bool__

__bool__() -> bool

Return True if nightlight is on or auto.

Off and unknown are False, all other True.

Source code in src\pyvesync\const.py
def __bool__(self) -> bool:
    """Return True if nightlight is on or auto.

    Off and unknown are False, all other True.
    """
    return self in [
        NightlightModes.ON, NightlightModes.AUTO, NightlightModes.DIM
        ]

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
class ColorMode(StrEnum):
    """VeSync bulb color modes.

    Attributes:
        RGB: RGB color mode.
        HSV: HSV color mode.
        WHITE: White color mode.
        COLOR: Color mode.
    """
    RGB = "rgb"
    HSV = "hsv"
    WHITE = "white"
    COLOR = "color"

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
class AirQualityLevel(Enum):
    """Representation of air quality levels as string and integers.

    Attributes:
        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:
        from_string(value: str | None) -> AirQualityLevel:
            Convert string value to corresponding integer.
        from_int(value: int | None) -> AirQualityLevel:
            Convert integer value to corresponding string.

    Note:
        Alias for "very good" is "excellent".
        Alias for "bad" is "poor".

    Usage:
        ```python
        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"
        ```
    """
    EXCELLENT = 1
    GOOD = 2
    MODERATE = 3
    POOR = 4
    UNKNOWN = -1

    def __int__(self) -> int:
        """Return integer representation of the enum."""
        return self.value

    def __str__(self) -> str:
        """Return string representation of the enum."""
        return self.name.lower()

    @classmethod
    def from_string(cls, 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.
        """
        _string_to_enum = MappingProxyType({
            "excellent": cls.EXCELLENT,
            "very good": cls.EXCELLENT,  # Alias
            "good": cls.GOOD,
            "moderate": cls.MODERATE,
            "poor": cls.POOR,
            "bad": cls.POOR,  # Alias
            "unknown": cls.UNKNOWN
        })
        if isinstance(value, str) and value.lower() in _string_to_enum:
            return AirQualityLevel(_string_to_enum[value.lower()])
        return cls.UNKNOWN

    @classmethod
    def from_int(cls, value: int | None) -> 'AirQualityLevel':
        """Convert integer value to corresponding string."""
        if value in [itm.value for itm in cls]:
            return cls(value)
        return cls.UNKNOWN

__int__

__int__() -> int

Return integer representation of the enum.

Source code in src\pyvesync\const.py
def __int__(self) -> int:
    """Return integer representation of the enum."""
    return self.value

__str__

__str__() -> str

Return string representation of the enum.

Source code in src\pyvesync\const.py
def __str__(self) -> str:
    """Return string representation of the enum."""
    return self.name.lower()

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
@classmethod
def from_string(cls, 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.
    """
    _string_to_enum = MappingProxyType({
        "excellent": cls.EXCELLENT,
        "very good": cls.EXCELLENT,  # Alias
        "good": cls.GOOD,
        "moderate": cls.MODERATE,
        "poor": cls.POOR,
        "bad": cls.POOR,  # Alias
        "unknown": cls.UNKNOWN
    })
    if isinstance(value, str) and value.lower() in _string_to_enum:
        return AirQualityLevel(_string_to_enum[value.lower()])
    return cls.UNKNOWN

from_int classmethod

from_int(value: int | None) -> AirQualityLevel

Convert integer value to corresponding string.

Source code in src\pyvesync\const.py
@classmethod
def from_int(cls, value: int | None) -> 'AirQualityLevel':
    """Convert integer value to corresponding string."""
    if value in [itm.value for itm in cls]:
        return cls(value)
    return cls.UNKNOWN

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
class PurifierAutoPreference(StrEnum):
    """Preference Levels for Purifier Auto Mode.

    Attributes:
        DEFAULT: Default preference level.
        EFFICIENT: Efficient preference level.
        QUIET: Quiet preference level.
        UNKNOWN: Unknown preference level.
    """
    DEFAULT = "default"
    EFFICIENT = "efficient"
    QUIET = "quiet"
    UNKNOWN = "unknown"

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
class FanSleepPreference(StrEnum):
    """Sleep mode preferences for VeSync fans.

    Attributes:
        DEFAULT: Default sleep mode.
        ADVANCED: Advanced sleep mode.
        TURBO: Turbo sleep mode.
        EFFICIENT: Efficient sleep mode.
        QUIET: Quiet sleep mode.
        UNKNOWN: Unknown sleep mode.
    """
    DEFAULT = "default"
    ADVANCED = "advanced"
    TURBO = "turbo"
    EFFICIENT = "efficient"
    QUIET = "quiet"
    TEMP_SENSE = "tempSense"
    KIDS = "kids"
    UNKNOWN = "unknown"

Features

Bases: StrEnum

Base Class for Features Enum to appease typing.

Source code in src\pyvesync\const.py
class Features(StrEnum):
    """Base Class for Features Enum to appease typing."""

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
class HumidifierFeatures(Features):
    """VeSync humidifier features.

    Attributes:
        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.
    """
    ONOFF = "onoff"
    CHILD_LOCK = "child_lock"
    NIGHTLIGHT = "night_light"
    WATER_LEVEL = "water_level"
    WARM_MIST = "warm_mist"
    AUTO_STOP = "auto_stop"
    NIGHTLIGHT_BRIGHTNESS = "nightlight_brightness"
    DRYING_MODE = "drying_mode"

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
class PurifierFeatures(Features):
    """VeSync air purifier features.

    Attributes:
        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.
    """
    RESET_FILTER = "reset_filter"
    CHILD_LOCK = "child_lock"
    NIGHTLIGHT = "night_light"
    AIR_QUALITY = "air_quality"
    VENT_ANGLE = "fan_rotate"
    LIGHT_DETECT = "light_detect"
    PM25 = "pm25"
    PM10 = "pm10"
    PM1 = "pm1"
    AQPERCENT = "aq_percent"

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
class PurifierStringLevels(Features):
    """String levels for Air Purifier fan speed.

    Attributes:
        LOW: Low fan speed.
        MEDIUM: Medium fan speed.
        HIGH: High fan speed.
    """
    LOW = "low"
    MEDIUM = "medium"
    HIGH = "high"

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
class BulbFeatures(Features):
    """VeSync bulb features.

    Attributes:
        ONOFF: Device on/off status.
        DIMMABLE: Dimmable status.
        COLOR_TEMP: Color temperature status.
        MULTICOLOR: Multicolor status.
    """
    ONOFF = "onoff"
    DIMMABLE = "dimmable"
    COLOR_TEMP = "color_temp"
    MULTICOLOR = "multicolor"

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
class OutletFeatures(Features):
    """VeSync outlet features.

    Attributes:
        ONOFF: Device on/off status.
        ENERGY_MONITOR: Energy monitor status.
        NIGHTLIGHT: Nightlight status.
    """
    ONOFF = "onoff"
    ENERGY_MONITOR = "energy_monitor"
    NIGHTLIGHT = "nightlight"

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
class SwitchFeatures(Features):
    """VeSync switch features.

    Attributes:
        ONOFF: Device on/off status.
        DIMMABLE: Dimmable status.
        INDICATOR_LIGHT: Indicator light status.
        BACKLIGHT: Backlight status.
        BACKLIGHT_RGB: RGB backlight status.
    """
    ONOFF = "onoff"
    DIMMABLE = "dimmable"
    INDICATOR_LIGHT = "indicator_light"
    BACKLIGHT = "backlight"
    BACKLIGHT_RGB = "backlight_rgb"

FanFeatures

Bases: Features

VeSync fan features.

Source code in src\pyvesync\const.py
class FanFeatures(Features):
    """VeSync fan features."""
    OSCILLATION = "oscillation"
    SOUND = "sound"
    DISPLAYING_TYPE = "displaying_type"  # Unknown functionality

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
class PurifierModes(Features):
    """VeSync air purifier modes.

    Attributes:
        AUTO: Auto mode.
        MANUAL: Manual mode.
        SLEEP: Sleep mode.
        TURBO: Turbo mode.
        PET: Pet mode.
        UNKNOWN: Unknown mode.
    """
    AUTO = "auto"
    MANUAL = "manual"
    SLEEP = "sleep"
    TURBO = "turbo"
    PET = "pet"
    UNKNOWN = "unknown"

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
class HumidifierModes(Features):
    """VeSync humidifier modes.

    Attributes:
        AUTO: Auto mode.
        MANUAL: Manual mode.
        HUMIDITY: Humidity mode.
        SLEEP: Sleep mode.
        TURBO: Turbo mode.
        PET: Pet mode.
        UNKNOWN: Unknown mode.
        AUTOPRO: AutoPro mode.
    """
    AUTO = "auto"
    MANUAL = "manual"
    HUMIDITY = "humidity"
    SLEEP = "sleep"
    TURBO = "turbo"
    PET = "pet"
    UNKNOWN = "unknown"
    AUTOPRO = "autopro"

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
class FanModes(StrEnum):
    """VeSync fan modes.

    Attributes:
        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.
    """
    AUTO = "auto"
    NORMAL = "normal"
    MANUAL = "normal"
    SLEEP = "advancedSleep"
    TURBO = "turbo"
    PET = "pet"
    UNKNOWN = "unknown"
    ADVANCED_SLEEP = "advancedSleep"

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
class ThermostatWorkModes(IntEnum):
    """Working modes for VeSync Aura thermostats.

    Based on the VeSync app and API values.

    Attributes:
        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).
    """
    OFF = 0
    HEAT = 1
    COOL = 2
    AUTO = 3
    EM_HEAT = 4
    SMART_AUTO = 5

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
class ThermostatFanModes(IntEnum):
    """Fan modes for VeSync Aura thermostats.

    Based on the VeSync app and API values.

    Attributes:
        AUTO: Fan is in auto mode (1).
        ON: Fan is on (2).
        CIRCULATE: Fan is in circulate mode (3).
    """
    AUTO = 1
    ON = 2
    CIRCULATE = 3

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
class ThermostatHoldOptions(IntEnumMixin):
    """Hold options for VeSync Aura thermostats.

    Attributes:
        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).
    """
    UNTIL_NEXT_SCHEDULED_ITEM = 2
    TWO_HOURS = 3
    FOUR_HOURS = 4
    PERMANENTLY = 5

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
class ThermostatHoldStatus(IntEnumMixin):
    """Set the hold status of the thermostat.

    Attributes:
        SET: Set the hold status (1).
        CANCEL: Cancel the hold status (0).
    """
    SET = 1
    CANCEL = 0

ThermostatScheduleOrHoldOptions

Bases: IntEnumMixin

Schedule or hold options for VeSync Aura thermostats.

Source code in src\pyvesync\const.py
class ThermostatScheduleOrHoldOptions(IntEnumMixin):
    """Schedule or hold options for VeSync Aura thermostats."""
    NOT_SCHEDULE_NOT_HOLD = 0
    ON_SCHEDULE = 1
    ON_HOLD = 2
    VACATION = 3

ThermostatEcoTypes

Bases: IntEnumMixin

Eco types for VeSync Aura thermostats.

Source code in src\pyvesync\const.py
class ThermostatEcoTypes(IntEnumMixin):
    """Eco types for VeSync Aura thermostats."""
    COMFORT_SECOND = 1
    COMFORT_FIRST = 2
    BALANCE = 3
    ECO_FIRST = 4
    ECO_SECOND = 5

ThermostatRoutineTypes

Bases: IntEnumMixin

Routine types for VeSync Aura thermostats.

Source code in src\pyvesync\const.py
class ThermostatRoutineTypes(IntEnumMixin):
    """Routine types for VeSync Aura thermostats."""
    HOME = 2
    AWAY = 1
    SLEEP = 3
    CUSTOM = 4

ThermostatAlarmCodes

Bases: IntEnumMixin

Alarm codes for VeSync Aura thermostats.

Source code in src\pyvesync\const.py
class ThermostatAlarmCodes(IntEnumMixin):
    """Alarm codes for VeSync Aura thermostats."""
    HEAT_COOL = 100
    ABOVE_SAFE_TEMP = 102
    HEAT_RUNNING_TIME_TOO_LONG = 104

ThermostatReminderCodes

Bases: IntEnumMixin

Reminder codes for VeSync Aura thermostats.

Source code in src\pyvesync\const.py
class ThermostatReminderCodes(IntEnumMixin):
    """Reminder codes for VeSync Aura thermostats."""
    FILTER = 150
    HVAC = 151

ThermostatWorkStatusCodes

Bases: IntEnumMixin

Work status codes for VeSync Aura thermostats.

Source code in src\pyvesync\const.py
class ThermostatWorkStatusCodes(IntEnumMixin):
    """Work status codes for VeSync Aura thermostats."""
    OFF = 0
    HEATING = 1
    COOLING = 2
    EM_HEATING = 3

ThermostatFanStatus

Bases: IntEnumMixin

Fan Status Enum for Aura Thermostats.

Source code in src\pyvesync\const.py
class ThermostatFanStatus(IntEnumMixin):
    """Fan Status Enum for Aura Thermostats."""
    OFF = 0
    ON = 1

ThermostatConst

Constants for VeSync Aura thermostats.

Source code in src\pyvesync\const.py
class ThermostatConst:
    """Constants for VeSync Aura thermostats."""
    ReminderCode = ThermostatReminderCodes
    AlarmCode = ThermostatAlarmCodes
    WorkMode = ThermostatWorkModes
    FanStatus = ThermostatFanStatus
    FanMode = ThermostatFanModes
    HoldOption = ThermostatHoldOptions
    EcoType = ThermostatEcoTypes
    RoutineType = ThermostatRoutineTypes
    ScheduleOrHoldOption = ThermostatScheduleOrHoldOptions
    WorkStatus = ThermostatWorkStatusCodes