Skip to content

VeSync Fans (NOT Purifiers or Humidifiers)

pyvesync.base_devices.fan_base.FanState

Bases: DeviceState

Base state class for Purifiers.

Not all attributes are supported by all devices. Attributes are set to UNKNOWN by default and attributes that are not supported by all devices are set to StrFlag.NOT_SUPPORTED or IntFlag.NOT_SUPPORTED.

Attributes:

Name Type Description
display_set_state str

Display set state.

display_status str

Display status.

displaying_type str

Displaying type.

fan_level int

Fan level.

fan_set_level int

Fan set level.

humidity int

Humidity level.

mode str

Mode of device.

mute_set_state str

Mute set state.

mute_status str

Mute status.

oscillation_set_state str

Oscillation set state.

oscillation_status str

Oscillation status.

sleep_change_fan_level str

Sleep change fan level.

sleep_fallasleep_remain str

Sleep fall asleep remain.

sleep_oscillation_switch str

Sleep oscillation switch.

sleep_preference_type str

Sleep preference type.

temperature int

Temperature.

thermal_comfort int

Thermal comfort.

timer Timer

Timer object.

Source code in src\pyvesync\base_devices\fan_base.py
class FanState(DeviceState):
    """Base state class for Purifiers.

    Not all attributes are supported by all devices. Attributes are set to
    UNKNOWN by default and attributes that are not supported by all devices are
    set to [StrFlag.NOT_SUPPORTED][pyvesync.const.StrFlag] or
    [IntFlag.NOT_SUPPORTED][pyvesync.const.IntFlag].


    Attributes:
        display_set_state (str): Display set state.
        display_status (str): Display status.
        displaying_type (str): Displaying type.
        fan_level (int): Fan level.
        fan_set_level (int): Fan set level.
        humidity (int): Humidity level.
        mode (str): Mode of device.
        mute_set_state (str): Mute set state.
        mute_status (str): Mute status.
        oscillation_set_state (str): Oscillation set state.
        oscillation_status (str): Oscillation status.
        sleep_change_fan_level (str): Sleep change fan level.
        sleep_fallasleep_remain (str): Sleep fall asleep remain.
        sleep_oscillation_switch (str): Sleep oscillation switch.
        sleep_preference_type (str): Sleep preference type.
        temperature (int): Temperature.
        thermal_comfort (int): Thermal comfort.
        timer (Timer): Timer object.
    """

    __slots__ = (
        "display_set_state",
        "display_status",
        "displaying_type",
        "fan_level",
        "fan_set_level",
        "humidity",
        "mode",
        "mute_set_state",
        "mute_status",
        "oscillation_set_state",
        "oscillation_status",
        "sleep_change_fan_level",
        "sleep_fallasleep_remain",
        "sleep_oscillation_switch",
        "sleep_preference_type",
        "temperature",
        "thermal_comfort",
    )

    def __init__(
        self,
        device: VeSyncFanBase,
        details: ResponseDeviceDetailsModel,
        feature_map: FanMap,
    ) -> None:
        """Initialize Purifier State.

        Args:
            device (VeSyncFanBase): Device object.
            details (ResponseDeviceDetailsModel): Device details.
            feature_map (FanMap): Feature map.
        """
        super().__init__(device, details, feature_map)
        self.mode: str = FanModes.UNKNOWN
        self.fan_level: int | None = None
        self.fan_set_level: int | None = None
        self.humidity: int | None = None
        self.temperature: int | None = None
        self.thermal_comfort: int | None = None
        self.sleep_preference_type: str | None = FanSleepPreference.UNKNOWN
        self.sleep_fallasleep_remain: str | None = DeviceStatus.UNKNOWN
        self.sleep_oscillation_switch: str | None = DeviceStatus.UNKNOWN
        self.sleep_change_fan_level: str | None = DeviceStatus.UNKNOWN
        self.mute_status: str = DeviceStatus.UNKNOWN
        self.mute_set_state: str = DeviceStatus.UNKNOWN
        self.oscillation_status: str = DeviceStatus.UNKNOWN
        self.oscillation_set_state: str = DeviceStatus.UNKNOWN
        self.display_status: str = DeviceStatus.UNKNOWN
        self.display_set_state: str = DeviceStatus.UNKNOWN
        self.displaying_type: str = StrFlag.NOT_SUPPORTED

Attributes

active_time instance-attribute

active_time: int | None = None

Inherited From DeviceState

connection_status instance-attribute

connection_status: str = connectionStatus or UNKNOWN

Inherited From DeviceState

device instance-attribute

device = device

Inherited From DeviceState

device_status instance-attribute

device_status: str = deviceStatus or UNKNOWN

Inherited From DeviceState

display_set_state instance-attribute

display_set_state: str = UNKNOWN

display_status instance-attribute

display_status: str = UNKNOWN

displaying_type instance-attribute

displaying_type: str = NOT_SUPPORTED

fan_level instance-attribute

fan_level: int | None = None

fan_set_level instance-attribute

fan_set_level: int | None = None

features instance-attribute

features = features

Inherited From DeviceState

humidity instance-attribute

humidity: int | None = None

last_update_ts instance-attribute

last_update_ts: int | None = None

Inherited From DeviceState

mode instance-attribute

mode: str = UNKNOWN

mute_set_state instance-attribute

mute_set_state: str = UNKNOWN

mute_status instance-attribute

mute_status: str = UNKNOWN

oscillation_set_state instance-attribute

oscillation_set_state: str = UNKNOWN

oscillation_status instance-attribute

oscillation_status: str = UNKNOWN

sleep_change_fan_level instance-attribute

sleep_change_fan_level: str | None = UNKNOWN

sleep_fallasleep_remain instance-attribute

sleep_fallasleep_remain: str | None = UNKNOWN

sleep_oscillation_switch instance-attribute

sleep_oscillation_switch: str | None = UNKNOWN

sleep_preference_type instance-attribute

sleep_preference_type: str | None = UNKNOWN

temperature instance-attribute

temperature: int | None = None

thermal_comfort instance-attribute

thermal_comfort: int | None = None

timer instance-attribute

timer: Timer | None = None

Inherited From DeviceState

Functions

as_tuple

as_tuple() -> tuple[tuple[str, Any], ...]

Inherited From DeviceState

Convert state to tuple of (name, value) tuples.

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
def as_tuple(self) -> tuple[tuple[str, Any], ...]:
    """Convert state to tuple of (name, value) tuples."""
    return tuple((k, v) for k, v in self._serialize().items())

display

display() -> None

Inherited From DeviceState

Print formatted state to stdout.

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
def display(self) -> None:
    """Print formatted state to stdout."""
    for name, val in self._serialize().items():
        print(f'{name:.<30} {val}')

to_dict

to_dict() -> dict[str, Any]

Inherited From DeviceState

Convert state to dictionary.

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
def to_dict(self) -> dict[str, Any]:
    """Convert state to dictionary."""
    return self._serialize()

to_json

to_json(indent: bool = False) -> str

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
def to_json(self, indent: bool = False) -> str:
    """Dump state to JSON string.

    Args:
        indent (bool): If True, indent JSON output, defaults to False.

    Returns:
        str: JSON formatted string of device state.
    """
    return self.to_jsonb(indent=indent).decode()

to_jsonb

to_jsonb(indent: bool = False) -> bytes

Inherited From DeviceState

Convert state to JSON bytes.

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
def to_jsonb(self, indent: bool = False) -> bytes:
    """Convert state to JSON bytes."""
    if indent:
        return orjson.dumps(
            self._serialize(), option=orjson.OPT_NON_STR_KEYS | orjson.OPT_INDENT_2
        )
    return orjson.dumps(self._serialize(), option=orjson.OPT_NON_STR_KEYS)

update_ts

update_ts() -> None

Inherited From DeviceState

Update last update timestamp.

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
def update_ts(self) -> None:
    """Update last update timestamp."""
    self.last_update_ts = int(dt.now(
        tz=ZoneInfo(self.device.manager.time_zone)).timestamp())

pyvesync.devices.vesyncfan.VeSyncTowerFan

VeSyncTowerFan(
    details: ResponseDeviceDetailsModel,
    manager: VeSync,
    feature_map: FanMap,
)

Bases: BypassV2Mixin, VeSyncFanBase

Levoit Tower Fan Device Class.

Inherited From VeSyncFanBase

Initialize VeSync device base class.

Initialize VeSync Tower Fan Base Class.

Parameters:

Name Type Description Default
details ResponseDeviceDetailsModel

Device details.

required
manager VeSync

Manager.

required
feature_map FanMap

Feature map.

required
See Also

See device_map for configured features and modes.

Initialize the VeSync Base API V2 Fan Class.

Attributes

cid instance-attribute

cid: str = cid

Inherited From VeSyncBaseDevice

config_module instance-attribute

config_module: str = configModule

Inherited From VeSyncBaseDevice

connection_type instance-attribute

connection_type: str | None = connectionType

Inherited From VeSyncBaseDevice

current_firm_version instance-attribute

current_firm_version = currentFirmVersion

Inherited From VeSyncBaseDevice

device_image instance-attribute

device_image: str | None = deviceImg

Inherited From VeSyncBaseDevice

device_name instance-attribute

device_name: str = deviceName

Inherited From VeSyncBaseDevice

device_region instance-attribute

device_region: str | None = deviceRegion

Inherited From VeSyncBaseDevice

device_type instance-attribute

device_type: str = deviceType

Inherited From VeSyncBaseDevice

enabled instance-attribute

enabled: bool = True

Inherited From VeSyncBaseDevice

fan_levels instance-attribute

fan_levels: list[int] = fan_levels

Inherited From VeSyncFanBase

features instance-attribute

features: list[str] = features

Inherited From VeSyncBaseDevice

firmware_update property

firmware_update: bool

Inherited From VeSyncBaseDevice

Return True if firmware update available.

This is going to be updated.

is_on property

is_on: bool

Inherited From VeSyncBaseDevice

Return true if device is on.

last_response instance-attribute

last_response: ResponseInfo | None = None

Inherited From VeSyncBaseDevice

mac_id instance-attribute

mac_id: str | None = macID

Inherited From VeSyncBaseDevice

manager instance-attribute

manager: VeSync

Inherited From BypassV2Mixin

modes instance-attribute

modes: list[str] = modes

Inherited From VeSyncFanBase

pid instance-attribute

pid: str | None = None

Inherited From VeSyncBaseDevice

product_type instance-attribute

product_type: str = product_type

Inherited From VeSyncBaseDevice

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

sleep_preferences instance-attribute

sleep_preferences: list[str] = sleep_preferences

Inherited From VeSyncFanBase

state instance-attribute

state: FanState = FanState(self, details, feature_map)

Inherited From VeSyncBaseDevice

sub_device_no instance-attribute

sub_device_no: int | None = subDeviceNo

Inherited From VeSyncBaseDevice

supports_displaying_type property

supports_displaying_type: bool

Inherited From VeSyncFanBase

Return True if device supports displaying type.

supports_mute property

supports_mute: bool

Inherited From VeSyncFanBase

Return True if device supports mute.

supports_oscillation property

supports_oscillation: bool

Inherited From VeSyncFanBase

Return True if device supports oscillation.

type instance-attribute

type: str | None = type

Inherited From VeSyncBaseDevice

uuid instance-attribute

uuid: str | None = uuid

Inherited From VeSyncBaseDevice

Functions

advanced_sleep_mode async deprecated

advanced_sleep_mode() -> bool

Inherited From VeSyncFanBase

Deprecated

Use set_advanced_sleep_mode method instead

Set advanced sleep mode.

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, e.g. /cloud/v2/deviceManaged/bypassV2.

'bypassV2'

Returns:

Name Type Description
bytes dict | None

The response from the API request.

clear_timer async

clear_timer() -> bool

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.

display

display(state: bool = True) -> None

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

displayJSON deprecated

displayJSON(state: bool = True, indent: bool = True) -> str

Inherited From VeSyncBaseDevice

Deprecated

Use to_json() instead

Return JSON details for device. - Deprecated use to_json().

get_details async

get_details() -> None

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.

get_state

get_state(state_attr: str) -> Any

Inherited From VeSyncBaseDevice

Get device state attribute.

get_timer async

get_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.

manual_mode async deprecated

manual_mode() -> bool

Inherited From VeSyncFanBase

Deprecated

Use set_manual_mode method instead

Adapter to set mode to normal.

mode_toggle async deprecated

mode_toggle(mode: str) -> bool

Inherited From VeSyncFanBase

Deprecated

Use set_mode method instead

Set mode to specified mode.

normal_mode async deprecated

normal_mode() -> bool

Inherited From VeSyncFanBase

Deprecated

Use set_normal_mode method instead

Set mode to normal.

set_advanced_sleep_mode async

set_advanced_sleep_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Advanced Sleep Mode.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

set_auto_mode async

set_auto_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Auto Mode.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

set_fan_speed async

set_fan_speed(speed: int | None = None) -> bool

Inherited From VeSyncFanBase

Set Purifier Fan Speed.

Parameters:

Name Type Description Default
speed int

Fan speed level according to device specs.

None

Returns:

Name Type Description
bool bool

Success of request.

set_manual_mode async

set_manual_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Manual Mode - Normal Mode.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

set_mode async

set_mode(mode: str) -> bool

Inherited From VeSyncFanBase

Set Purifier Mode.

Parameters:

Name Type Description Default
mode str

Mode to set, varies by device type.

required

Returns:

Name Type Description
bool bool

Success of request.

set_normal_mode async

set_normal_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Normal Mode.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

set_sleep_mode async

set_sleep_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Sleep Mode.

This is also referred to as Advanced Sleep Mode on some devices.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

set_state

set_state(state_attr: str, stat_value: Any) -> None

Inherited From VeSyncBaseDevice

Set device state attribute.

set_timer async

set_timer(duration: int, action: str | None = None) -> bool

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.

set_turbo_mode async

set_turbo_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Turbo Mode.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

sleep_mode async deprecated

sleep_mode() -> bool

Inherited From VeSyncFanBase

Deprecated

Use set_sleep_mode method instead

Adapter to set advanced sleep mode.

to_dict

to_dict(state: bool = True) -> dict[str, Any]

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.

to_json

to_json(state: bool = True, indent: bool = True) -> str

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.

to_jsonb

to_jsonb(state: bool = True, indent: bool = True) -> bytes

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.

{
    "Device Name": "Living Room Lamp",
    "Model": "ESL100",
    "Subdevice No": "0",
    "Type": "wifi",
    "CID": "1234567890abcdef"
}

toggle_display async

toggle_display(toggle: bool) -> bool

Inherited From VeSyncFanBase

Toggle Display on/off.

Parameters:

Name Type Description Default
toggle bool

Display state.

required

Returns:

Name Type Description
bool bool

Success of request.

toggle_displaying_type async

toggle_displaying_type(toggle: bool) -> bool

Inherited From VeSyncFanBase

Toggle displaying type on/off.

This functionality is unknown but was in the API calls.

Parameters:

Name Type Description Default
toggle bool

Displaying type state.

required

Returns:

Name Type Description
bool bool

true if success.

Set displaying type on/off - Unknown functionality.

toggle_mute async

toggle_mute(toggle: bool) -> bool

Inherited From VeSyncFanBase

Toggle mute on/off.

Parameters:

Name Type Description Default
toggle

bool True to turn mute on, False to turn off

required

Returns:

Name Type Description
bool bool

True if successful, False if not

toggle_oscillation async

toggle_oscillation(toggle: bool) -> bool

Inherited From VeSyncFanBase

Toggle Oscillation on/off.

Parameters:

Name Type Description Default
toggle bool

Oscillation state.

required

Returns:

Name Type Description
bool bool

true if success.

toggle_switch abstractmethod async

toggle_switch(toggle: bool | None = None) -> bool

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.

turn_off async

turn_off() -> bool

Inherited From VeSyncBaseToggleDevice

Turn device off.

turn_off_display async

turn_off_display() -> bool

Inherited From VeSyncFanBase

Turn off Display.

Returns:

Name Type Description
bool bool

Success of request

turn_off_mute async

turn_off_mute() -> bool

Inherited From VeSyncFanBase

Set toggle_mute to off.

turn_off_oscillation async

turn_off_oscillation() -> bool

Inherited From VeSyncFanBase

Set toggle_oscillation to off.

turn_on async

turn_on() -> bool

Inherited From VeSyncBaseToggleDevice

Turn device on.

turn_on_display async

turn_on_display() -> bool

Inherited From VeSyncFanBase

Turn on Display.

Returns:

Name Type Description
bool bool

Success of request

turn_on_mute async

turn_on_mute() -> bool

Inherited From VeSyncFanBase

Set toggle_mute to on.

turn_on_oscillation async

turn_on_oscillation() -> bool

Inherited From VeSyncFanBase

Set toggle_oscillation to on.

update async

update() -> None

Inherited From VeSyncBaseDevice

Update device details.

pyvesync.base_devices.fan_base.VeSyncFanBase

Bases: VeSyncBaseToggleDevice

Base device for VeSync tower fans.

Inherits from VeSyncBaseToggleDevice and VeSyncBaseDevice.

Attributes:

Name Type Description
fan_levels list[int]

Fan levels supported by device.

modes list[str]

Modes supported by device.

sleep_preferences list[str]

Sleep preferences supported by device.

Source code in src\pyvesync\base_devices\fan_base.py
class VeSyncFanBase(VeSyncBaseToggleDevice):
    """Base device for VeSync tower fans.

    Inherits from
    [VeSyncBaseToggleDevice][pyvesync.base_devices.vesyncbasedevice.VeSyncBaseToggleDevice]
    and [VeSyncBaseDevice][pyvesync.base_devices.vesyncbasedevice.VeSyncBaseDevice].

    Attributes:
        fan_levels (list[int]): Fan levels supported by device.
        modes (list[str]): Modes supported by device.
        sleep_preferences (list[str]): Sleep preferences supported by device.
    """

    __slots__ = (
        "fan_levels",
        "modes",
        "sleep_preferences",
    )

    def __init__(
        self,
        details: ResponseDeviceDetailsModel,
        manager: VeSync,
        feature_map: FanMap,
    ) -> None:
        """Initialize VeSync Tower Fan Base Class.

        Args:
            details (ResponseDeviceDetailsModel): Device details.
            manager (VeSync): Manager.
            feature_map (FanMap): Feature map.

        See Also:
            See [device_map][pyvesync.device_map] for configured features and modes.
        """
        super().__init__(details, manager, feature_map)
        self.features: list[str] = feature_map.features
        self.state: FanState = FanState(self, details, feature_map)
        self.modes: list[str] = feature_map.modes
        self.fan_levels: list[int] = feature_map.fan_levels
        self.sleep_preferences: list[str] = feature_map.sleep_preferences

    @property
    def supports_oscillation(self) -> bool:
        """Return True if device supports oscillation."""
        return FanFeatures.OSCILLATION in self.features

    @property
    def supports_mute(self) -> bool:
        """Return True if device supports mute."""
        return FanFeatures.SOUND in self.features

    @property
    def supports_displaying_type(self) -> bool:
        """Return True if device supports displaying type."""
        return FanFeatures.DISPLAYING_TYPE in self.features

    async def toggle_display(self, toggle: bool) -> bool:
        """Toggle Display on/off.

        Args:
            toggle (bool): Display state.

        Returns:
            bool: Success of request.
        """
        del toggle
        return False

    async def turn_on_display(self) -> bool:
        """Turn on Display.

        Returns:
            bool: Success of request
        """
        return await self.toggle_display(True)

    async def turn_off_display(self) -> bool:
        """Turn off Display.

        Returns:
            bool: Success of request
        """
        return await self.toggle_display(False)

    @abstractmethod
    async def set_mode(self, mode: str) -> bool:
        """Set Purifier Mode.

        Args:
            mode (str): Mode to set, varies by device type.

        Returns:
            bool: Success of request.
        """

    @abstractmethod
    async def set_fan_speed(self, speed: int | None = None) -> bool:
        """Set Purifier Fan Speed.

        Args:
            speed (int, optional): Fan speed level according to device specs.

        Returns:
            bool: Success of request.
        """

    async def set_auto_mode(self) -> bool:
        """Set Purifier to Auto Mode.

        Returns:
            bool: Success of request.

        Note:
            This method is not supported by all devices, will return
            false with warning debug message if not supported.
        """
        if FanModes.AUTO in self.modes:
            return await self.set_mode(FanModes.AUTO)
        logger.warning("Auto mode not supported for this device.")
        return False

    async def set_advanced_sleep_mode(self) -> bool:
        """Set Purifier to Advanced Sleep Mode.

        Returns:
            bool: Success of request.

        Note:
            This method is not supported by all devices, will return
            false with warning debug message if not supported.
        """
        if FanModes.ADVANCED_SLEEP in self.modes:
            return await self.set_mode(FanModes.ADVANCED_SLEEP)
        logger.warning("Advanced Sleep mode not supported for this device.")
        return False

    async def set_sleep_mode(self) -> bool:
        """Set Purifier to Sleep Mode.

        This is also referred to as Advanced Sleep Mode on some devices.

        Returns:
            bool: Success of request.

        Note:
            This method is not supported by all devices, will return
            false with warning debug message if not supported.
        """
        if FanModes.ADVANCED_SLEEP in self.modes:
            return await self.set_mode(FanModes.ADVANCED_SLEEP)
        logger.warning("Sleep mode not supported for this device.")
        return False

    async def set_manual_mode(self) -> bool:
        """Set Purifier to Manual Mode - Normal Mode.

        Returns:
            bool: Success of request.

        Note:
            This method is not supported by all devices, will return
            false with warning debug message if not supported.
        """
        if FanModes.NORMAL in self.modes:
            return await self.set_mode(FanModes.NORMAL)
        logger.warning("Manual mode not supported for this device.")
        return False

    async def set_normal_mode(self) -> bool:
        """Set Purifier to Normal Mode.

        Returns:
            bool: Success of request.

        Note:
            This method is not supported by all devices, will return
            false with warning debug message if not supported.
        """
        if FanModes.NORMAL in self.modes:
            return await self.set_mode(FanModes.NORMAL)
        logger.warning("Normal mode not supported for this device.")
        return False

    async def set_turbo_mode(self) -> bool:
        """Set Purifier to Turbo Mode.

        Returns:
            bool: Success of request.

        Note:
            This method is not supported by all devices, will return
            false with warning debug message if not supported.
        """
        if FanModes.TURBO in self.modes:
            return await self.set_mode(FanModes.TURBO)
        logger.warning("Turbo mode not supported for this device.")
        return False

    async def toggle_oscillation(self, toggle: bool) -> bool:
        """Toggle Oscillation on/off.

        Args:
            toggle (bool): Oscillation state.

        Returns:
            bool: true if success.
        """
        del toggle
        if self.supports_oscillation:
            logger.debug("Oscillation not configured for this device.")
        else:
            logger.debug("Oscillation not supported for this device.")
        return False

    async def turn_on_oscillation(self) -> bool:
        """Set toggle_oscillation to on."""
        return await self.toggle_oscillation(True)

    async def turn_off_oscillation(self) -> bool:
        """Set toggle_oscillation to off."""
        return await self.toggle_oscillation(False)

    async def toggle_mute(self, toggle: bool) -> bool:
        """Toggle mute on/off.

        Parameters:
            toggle : bool
                True to turn mute on, False to turn off

        Returns:
            bool : True if successful, False if not
        """
        del toggle
        if self.supports_mute:
            logger.debug("Mute not configured for this device.")
        else:
            logger.debug("Mute not supported for this device.")
        return False

    async def turn_on_mute(self) -> bool:
        """Set toggle_mute to on."""
        return await self.toggle_mute(True)

    async def turn_off_mute(self) -> bool:
        """Set toggle_mute to off."""
        return await self.toggle_mute(False)

    async def toggle_displaying_type(self, toggle: bool) -> bool:
        """Toggle displaying type on/off.

        This functionality is unknown but was in the API calls.

        Args:
            toggle (bool): Displaying type state.

        Returns:
            bool: true if success.
        """
        del toggle
        if self.supports_displaying_type:
            logger.debug("Displaying type not configured for this device.")
        else:
            logger.debug("Displaying type not supported for this device.")
        return False

    @deprecated("Use `set_normal_mode` method instead")
    async def normal_mode(self) -> bool:
        """Set mode to normal."""
        return await self.set_normal_mode()

    @deprecated("Use `set_manual_mode` method instead")
    async def manual_mode(self) -> bool:
        """Adapter to set mode to normal."""
        return await self.set_normal_mode()

    @deprecated("Use `set_advanced_sleep_mode` method instead")
    async def advanced_sleep_mode(self) -> bool:
        """Set advanced sleep mode."""
        return await self.set_mode('advancedSleep')

    @deprecated("Use `set_sleep_mode` method instead")
    async def sleep_mode(self) -> bool:
        """Adapter to set advanced sleep mode."""
        return await self.set_advanced_sleep_mode()

    @deprecated("Use `set_mode` method instead")
    async def mode_toggle(self, mode: str) -> bool:
        """Set mode to specified mode."""
        return await self.set_mode(mode)

Attributes

cid instance-attribute

cid: str = cid

Inherited From VeSyncBaseDevice

config_module instance-attribute

config_module: str = configModule

Inherited From VeSyncBaseDevice

connection_type instance-attribute

connection_type: str | None = connectionType

Inherited From VeSyncBaseDevice

current_firm_version instance-attribute

current_firm_version = currentFirmVersion

Inherited From VeSyncBaseDevice

device_image instance-attribute

device_image: str | None = deviceImg

Inherited From VeSyncBaseDevice

device_name instance-attribute

device_name: str = deviceName

Inherited From VeSyncBaseDevice

device_region instance-attribute

device_region: str | None = deviceRegion

Inherited From VeSyncBaseDevice

device_type instance-attribute

device_type: str = deviceType

Inherited From VeSyncBaseDevice

enabled instance-attribute

enabled: bool = True

Inherited From VeSyncBaseDevice

fan_levels instance-attribute

fan_levels: list[int] = fan_levels

Inherited From VeSyncFanBase

features instance-attribute

features: list[str] = features

Inherited From VeSyncBaseDevice

firmware_update property

firmware_update: bool

Inherited From VeSyncBaseDevice

Return True if firmware update available.

This is going to be updated.

is_on property

is_on: bool

Inherited From VeSyncBaseDevice

Return true if device is on.

last_response instance-attribute

last_response: ResponseInfo | None = None

Inherited From VeSyncBaseDevice

mac_id instance-attribute

mac_id: str | None = macID

Inherited From VeSyncBaseDevice

manager instance-attribute

manager = manager

Inherited From VeSyncBaseDevice

modes instance-attribute

modes: list[str] = modes

Inherited From VeSyncFanBase

pid instance-attribute

pid: str | None = None

Inherited From VeSyncBaseDevice

product_type instance-attribute

product_type: str = product_type

Inherited From VeSyncBaseDevice

sleep_preferences instance-attribute

sleep_preferences: list[str] = sleep_preferences

Inherited From VeSyncFanBase

state instance-attribute

state: FanState = FanState(self, details, feature_map)

Inherited From VeSyncBaseDevice

sub_device_no instance-attribute

sub_device_no: int | None = subDeviceNo

Inherited From VeSyncBaseDevice

supports_displaying_type property

supports_displaying_type: bool

Inherited From VeSyncFanBase

Return True if device supports displaying type.

supports_mute property

supports_mute: bool

Inherited From VeSyncFanBase

Return True if device supports mute.

supports_oscillation property

supports_oscillation: bool

Inherited From VeSyncFanBase

Return True if device supports oscillation.

type instance-attribute

type: str | None = type

Inherited From VeSyncBaseDevice

uuid instance-attribute

uuid: str | None = uuid

Inherited From VeSyncBaseDevice

Functions

advanced_sleep_mode async deprecated

advanced_sleep_mode() -> bool

Inherited From VeSyncFanBase

Deprecated

Use set_advanced_sleep_mode method instead

Set advanced sleep mode.

Source code in src\pyvesync\base_devices\fan_base.py
@deprecated("Use `set_advanced_sleep_mode` method instead")
async def advanced_sleep_mode(self) -> bool:
    """Set advanced sleep mode."""
    return await self.set_mode('advancedSleep')

clear_timer async

clear_timer() -> bool

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
async def clear_timer(self) -> bool:
    """Clear timer for device from API.

    This may not be implemented for all devices. Please open an issue
    if there is an error.

    Returns:
        bool: True if successful, False otherwise.
    """
    logger.debug('Not implemented - clear_timer')
    return False

display

display(state: bool = True) -> None

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
def display(self, state: bool = True) -> None:
    """Print formatted static device info to stdout.

    Args:
        state (bool): If True, include state in display, defaults to True.

    Example:
    ```
    Device Name:..................Living Room Lamp
    Model:........................ESL100
    Subdevice No:.................0
    Type:.........................wifi
    CID:..........................1234567890abcdef
    ```
    """
    # noinspection SpellCheckingInspection
    display_list = [
        ('Device Name:', self.device_name),
        ('Product Type: ', self.product_type),
        ('Model: ', self.device_type),
        ('Subdevice No: ', str(self.sub_device_no)),
        ('Type: ', self.type),
        ('CID: ', self.cid),
        ('Config Module: ', self.config_module),
        ('Connection Type: ', self.connection_type),
        ('Features', self.features),
        ('Last Response: ', self.last_response),
    ]
    if self.uuid is not None:
        display_list.append(('UUID: ', self.uuid))

    for line in display_list:
        print(f'{line[0]:.<30} {line[1]}')
    if state:
        self.state.display()

displayJSON deprecated

displayJSON(state: bool = True, indent: bool = True) -> str

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
@deprecated("Use to_json() instead")
def displayJSON(self, state: bool = True, indent: bool = True) -> str:  # pylint: disable=invalid-name
    """Return JSON details for device. - Deprecated use to_json()."""
    return self.to_json(state, indent)

get_details abstractmethod async

get_details() -> None

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
@abstractmethod
async def get_details(self) -> None:
    """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.
    """

get_state

get_state(state_attr: str) -> Any

Inherited From VeSyncBaseDevice

Get device state attribute.

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
def get_state(self, state_attr: str) -> Any:  # noqa: ANN401
    """Get device state attribute."""
    return getattr(self.state, state_attr)

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
async def get_timer(self) -> Timer | None:
    """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.
    """
    logger.debug('Not implemented - get_timer')
    return None

manual_mode async deprecated

manual_mode() -> bool

Inherited From VeSyncFanBase

Deprecated

Use set_manual_mode method instead

Adapter to set mode to normal.

Source code in src\pyvesync\base_devices\fan_base.py
@deprecated("Use `set_manual_mode` method instead")
async def manual_mode(self) -> bool:
    """Adapter to set mode to normal."""
    return await self.set_normal_mode()

mode_toggle async deprecated

mode_toggle(mode: str) -> bool

Inherited From VeSyncFanBase

Deprecated

Use set_mode method instead

Set mode to specified mode.

Source code in src\pyvesync\base_devices\fan_base.py
@deprecated("Use `set_mode` method instead")
async def mode_toggle(self, mode: str) -> bool:
    """Set mode to specified mode."""
    return await self.set_mode(mode)

normal_mode async deprecated

normal_mode() -> bool

Inherited From VeSyncFanBase

Deprecated

Use set_normal_mode method instead

Set mode to normal.

Source code in src\pyvesync\base_devices\fan_base.py
@deprecated("Use `set_normal_mode` method instead")
async def normal_mode(self) -> bool:
    """Set mode to normal."""
    return await self.set_normal_mode()

set_advanced_sleep_mode async

set_advanced_sleep_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Advanced Sleep Mode.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

Source code in src\pyvesync\base_devices\fan_base.py
async def set_advanced_sleep_mode(self) -> bool:
    """Set Purifier to Advanced Sleep Mode.

    Returns:
        bool: Success of request.

    Note:
        This method is not supported by all devices, will return
        false with warning debug message if not supported.
    """
    if FanModes.ADVANCED_SLEEP in self.modes:
        return await self.set_mode(FanModes.ADVANCED_SLEEP)
    logger.warning("Advanced Sleep mode not supported for this device.")
    return False

set_auto_mode async

set_auto_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Auto Mode.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

Source code in src\pyvesync\base_devices\fan_base.py
async def set_auto_mode(self) -> bool:
    """Set Purifier to Auto Mode.

    Returns:
        bool: Success of request.

    Note:
        This method is not supported by all devices, will return
        false with warning debug message if not supported.
    """
    if FanModes.AUTO in self.modes:
        return await self.set_mode(FanModes.AUTO)
    logger.warning("Auto mode not supported for this device.")
    return False

set_fan_speed abstractmethod async

set_fan_speed(speed: int | None = None) -> bool

Set Purifier Fan Speed.

Parameters:

Name Type Description Default
speed int

Fan speed level according to device specs.

None

Returns:

Name Type Description
bool bool

Success of request.

Source code in src\pyvesync\base_devices\fan_base.py
@abstractmethod
async def set_fan_speed(self, speed: int | None = None) -> bool:
    """Set Purifier Fan Speed.

    Args:
        speed (int, optional): Fan speed level according to device specs.

    Returns:
        bool: Success of request.
    """

set_manual_mode async

set_manual_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Manual Mode - Normal Mode.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

Source code in src\pyvesync\base_devices\fan_base.py
async def set_manual_mode(self) -> bool:
    """Set Purifier to Manual Mode - Normal Mode.

    Returns:
        bool: Success of request.

    Note:
        This method is not supported by all devices, will return
        false with warning debug message if not supported.
    """
    if FanModes.NORMAL in self.modes:
        return await self.set_mode(FanModes.NORMAL)
    logger.warning("Manual mode not supported for this device.")
    return False

set_mode abstractmethod async

set_mode(mode: str) -> bool

Set Purifier Mode.

Parameters:

Name Type Description Default
mode str

Mode to set, varies by device type.

required

Returns:

Name Type Description
bool bool

Success of request.

Source code in src\pyvesync\base_devices\fan_base.py
@abstractmethod
async def set_mode(self, mode: str) -> bool:
    """Set Purifier Mode.

    Args:
        mode (str): Mode to set, varies by device type.

    Returns:
        bool: Success of request.
    """

set_normal_mode async

set_normal_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Normal Mode.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

Source code in src\pyvesync\base_devices\fan_base.py
async def set_normal_mode(self) -> bool:
    """Set Purifier to Normal Mode.

    Returns:
        bool: Success of request.

    Note:
        This method is not supported by all devices, will return
        false with warning debug message if not supported.
    """
    if FanModes.NORMAL in self.modes:
        return await self.set_mode(FanModes.NORMAL)
    logger.warning("Normal mode not supported for this device.")
    return False

set_sleep_mode async

set_sleep_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Sleep Mode.

This is also referred to as Advanced Sleep Mode on some devices.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

Source code in src\pyvesync\base_devices\fan_base.py
async def set_sleep_mode(self) -> bool:
    """Set Purifier to Sleep Mode.

    This is also referred to as Advanced Sleep Mode on some devices.

    Returns:
        bool: Success of request.

    Note:
        This method is not supported by all devices, will return
        false with warning debug message if not supported.
    """
    if FanModes.ADVANCED_SLEEP in self.modes:
        return await self.set_mode(FanModes.ADVANCED_SLEEP)
    logger.warning("Sleep mode not supported for this device.")
    return False

set_state

set_state(state_attr: str, stat_value: Any) -> None

Inherited From VeSyncBaseDevice

Set device state attribute.

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
def set_state(self, state_attr: str, stat_value: Any) -> None:  # noqa: ANN401
    """Set device state attribute."""
    setattr(self, state_attr, stat_value)

set_timer async

set_timer(duration: int, action: str | None = None) -> bool

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
async def set_timer(self, duration: int, action: str | None = None) -> bool:
    """Set timer for device.

    This may not be implemented for all devices. Please open an issue
    if there is an error.

    Args:
        duration (int): Duration in seconds.
        action (str | None): Action to take when timer expires.

    Returns:
        bool: True if successful, False otherwise.
    """
    del duration
    del action
    logger.debug('Not implemented - set_timer')
    return False

set_turbo_mode async

set_turbo_mode() -> bool

Inherited From VeSyncFanBase

Set Purifier to Turbo Mode.

Returns:

Name Type Description
bool bool

Success of request.

Note

This method is not supported by all devices, will return false with warning debug message if not supported.

Source code in src\pyvesync\base_devices\fan_base.py
async def set_turbo_mode(self) -> bool:
    """Set Purifier to Turbo Mode.

    Returns:
        bool: Success of request.

    Note:
        This method is not supported by all devices, will return
        false with warning debug message if not supported.
    """
    if FanModes.TURBO in self.modes:
        return await self.set_mode(FanModes.TURBO)
    logger.warning("Turbo mode not supported for this device.")
    return False

sleep_mode async deprecated

sleep_mode() -> bool

Inherited From VeSyncFanBase

Deprecated

Use set_sleep_mode method instead

Adapter to set advanced sleep mode.

Source code in src\pyvesync\base_devices\fan_base.py
@deprecated("Use `set_sleep_mode` method instead")
async def sleep_mode(self) -> bool:
    """Adapter to set advanced sleep mode."""
    return await self.set_advanced_sleep_mode()

to_dict

to_dict(state: bool = True) -> dict[str, Any]

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
def to_dict(self, state: bool = True) -> dict[str, Any]:
    """Return device information as a dictionary.

    Args:
        state (bool): If True, include state in dictionary, defaults to True.

    Returns:
        dict[str, Any]: Dictionary containing device information.
    """
    device_dict = {
        "device_name": self.device_name,
        "product_type": self.product_type,
        "model": self.device_type,
        "subdevice_no": str(self.sub_device_no),
        "type": self.type,
        "cid": self.cid,
        "features:": self.features,
        "config_module": self.config_module,
        "connection_type": self.connection_type,
        "last_response": self.last_response,
    }
    state_dict = self.state.to_dict() if state else {}
    return device_dict | state_dict

to_json

to_json(state: bool = True, indent: bool = True) -> str

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
def to_json(self, state: bool = True, indent: bool = True) -> str:
    """Print JSON API string for device details.

    Args:
        state (bool): If True, include state in JSON output, defaults to True.
        indent (bool): If True, indent JSON output, defaults to True.

    Returns:
        str: JSON formatted string of device details.
    """
    return self.to_jsonb(state, indent).decode()

to_jsonb

to_jsonb(state: bool = True, indent: bool = True) -> bytes

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.

{
    "Device Name": "Living Room Lamp",
    "Model": "ESL100",
    "Subdevice No": "0",
    "Type": "wifi",
    "CID": "1234567890abcdef"
}

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
def to_jsonb(self, state: bool = True, indent: bool = True) -> bytes:
    """JSON API bytes for device details.

    Args:
        state (bool): If True, include state in JSON output, defaults to True.
        indent (bool): If True, indent JSON output, defaults to True.

    Returns:
        bytes: JSON formatted bytes of device details.

    Example:
        This is an example without state.
        ```
        {
            "Device Name": "Living Room Lamp",
            "Model": "ESL100",
            "Subdevice No": "0",
            "Type": "wifi",
            "CID": "1234567890abcdef"
        }
        ```
    """
    return_dict = self.to_dict(state=state)
    if indent:
        return orjson.dumps(
            return_dict,
            option=orjson.OPT_INDENT_2 | orjson.OPT_NON_STR_KEYS,
        )

    return orjson.dumps(return_dict, option=orjson.OPT_NON_STR_KEYS)

toggle_display async

toggle_display(toggle: bool) -> bool

Toggle Display on/off.

Parameters:

Name Type Description Default
toggle bool

Display state.

required

Returns:

Name Type Description
bool bool

Success of request.

Source code in src\pyvesync\base_devices\fan_base.py
async def toggle_display(self, toggle: bool) -> bool:
    """Toggle Display on/off.

    Args:
        toggle (bool): Display state.

    Returns:
        bool: Success of request.
    """
    del toggle
    return False

toggle_displaying_type async

toggle_displaying_type(toggle: bool) -> bool

Toggle displaying type on/off.

This functionality is unknown but was in the API calls.

Parameters:

Name Type Description Default
toggle bool

Displaying type state.

required

Returns:

Name Type Description
bool bool

true if success.

Source code in src\pyvesync\base_devices\fan_base.py
async def toggle_displaying_type(self, toggle: bool) -> bool:
    """Toggle displaying type on/off.

    This functionality is unknown but was in the API calls.

    Args:
        toggle (bool): Displaying type state.

    Returns:
        bool: true if success.
    """
    del toggle
    if self.supports_displaying_type:
        logger.debug("Displaying type not configured for this device.")
    else:
        logger.debug("Displaying type not supported for this device.")
    return False

toggle_mute async

toggle_mute(toggle: bool) -> bool

Toggle mute on/off.

Parameters:

Name Type Description Default
toggle

bool True to turn mute on, False to turn off

required

Returns:

Name Type Description
bool bool

True if successful, False if not

Source code in src\pyvesync\base_devices\fan_base.py
async def toggle_mute(self, toggle: bool) -> bool:
    """Toggle mute on/off.

    Parameters:
        toggle : bool
            True to turn mute on, False to turn off

    Returns:
        bool : True if successful, False if not
    """
    del toggle
    if self.supports_mute:
        logger.debug("Mute not configured for this device.")
    else:
        logger.debug("Mute not supported for this device.")
    return False

toggle_oscillation async

toggle_oscillation(toggle: bool) -> bool

Toggle Oscillation on/off.

Parameters:

Name Type Description Default
toggle bool

Oscillation state.

required

Returns:

Name Type Description
bool bool

true if success.

Source code in src\pyvesync\base_devices\fan_base.py
async def toggle_oscillation(self, toggle: bool) -> bool:
    """Toggle Oscillation on/off.

    Args:
        toggle (bool): Oscillation state.

    Returns:
        bool: true if success.
    """
    del toggle
    if self.supports_oscillation:
        logger.debug("Oscillation not configured for this device.")
    else:
        logger.debug("Oscillation not supported for this device.")
    return False

toggle_switch abstractmethod async

toggle_switch(toggle: bool | None = None) -> bool

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
@abstractmethod
async def toggle_switch(self, toggle: bool | None = None) -> bool:
    """Toggle device power on or off.

    Args:
        toggle (bool | None): True to turn on, False to turn off, None to toggle.

    Returns:
        bool: True if successful, False otherwise.
    """

turn_off async

turn_off() -> bool

Inherited From VeSyncBaseToggleDevice

Turn device off.

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
async def turn_off(self) -> bool:
    """Turn device off."""
    return await self.toggle_switch(False)

turn_off_display async

turn_off_display() -> bool

Inherited From VeSyncFanBase

Turn off Display.

Returns:

Name Type Description
bool bool

Success of request

Source code in src\pyvesync\base_devices\fan_base.py
async def turn_off_display(self) -> bool:
    """Turn off Display.

    Returns:
        bool: Success of request
    """
    return await self.toggle_display(False)

turn_off_mute async

turn_off_mute() -> bool

Inherited From VeSyncFanBase

Set toggle_mute to off.

Source code in src\pyvesync\base_devices\fan_base.py
async def turn_off_mute(self) -> bool:
    """Set toggle_mute to off."""
    return await self.toggle_mute(False)

turn_off_oscillation async

turn_off_oscillation() -> bool

Inherited From VeSyncFanBase

Set toggle_oscillation to off.

Source code in src\pyvesync\base_devices\fan_base.py
async def turn_off_oscillation(self) -> bool:
    """Set toggle_oscillation to off."""
    return await self.toggle_oscillation(False)

turn_on async

turn_on() -> bool

Inherited From VeSyncBaseToggleDevice

Turn device on.

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
async def turn_on(self) -> bool:
    """Turn device on."""
    return await self.toggle_switch(True)

turn_on_display async

turn_on_display() -> bool

Inherited From VeSyncFanBase

Turn on Display.

Returns:

Name Type Description
bool bool

Success of request

Source code in src\pyvesync\base_devices\fan_base.py
async def turn_on_display(self) -> bool:
    """Turn on Display.

    Returns:
        bool: Success of request
    """
    return await self.toggle_display(True)

turn_on_mute async

turn_on_mute() -> bool

Inherited From VeSyncFanBase

Set toggle_mute to on.

Source code in src\pyvesync\base_devices\fan_base.py
async def turn_on_mute(self) -> bool:
    """Set toggle_mute to on."""
    return await self.toggle_mute(True)

turn_on_oscillation async

turn_on_oscillation() -> bool

Inherited From VeSyncFanBase

Set toggle_oscillation to on.

Source code in src\pyvesync\base_devices\fan_base.py
async def turn_on_oscillation(self) -> bool:
    """Set toggle_oscillation to on."""
    return await self.toggle_oscillation(True)

update async

update() -> None

Inherited From VeSyncBaseDevice

Update device details.

Source code in src\pyvesync\base_devices\vesyncbasedevice.py
async def update(self) -> None:
    """Update device details."""
    await self.get_details()