Documentation for Etekcity / Valceno Smart Bulbs↲
Table of Contents↲
See each device class for available attributes and methods:
- BulbState Class
- Etekcity Smart Bulb ESL100
- Etekcity Smart Bulb ESL100CW
- Etekcity Smart Bulb ESL100MC
- Valceno Smart Bulb ESL100MC
- VeSyncBulb Abstract Base Class
pyvesync.base_devices.bulb_base.BulbState ↲
BulbState(
device: VeSyncBulb,
details: ResponseDeviceDetailsModel,
feature_map: BulbMap,
)
Bases: DeviceState
VeSync Bulb State Base.
Base class to hold all state attributes for bulb devices. Inherits from
DeviceState
. This
class should not be used directly for devices, but rather subclassed for each
bulb type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
device
|
VeSyncBulb
|
VeSync Bulb device. |
required |
details
|
ResponseDeviceDetailsModel
|
Device details from API. |
required |
feature_map
|
BulbMap
|
Feature map for bulb. |
required |
Attributes:
Name | Type | Description |
---|---|---|
_exclude_serialization |
list[str]
|
List of attributes to exclude from serialization. |
active_time |
int
|
Active time of device, defaults to None. |
connection_status |
str
|
Connection status of device. |
device |
VeSyncBaseDevice
|
Device object. |
device_status |
str
|
Device status. |
features |
dict
|
Features of device. |
last_update_ts |
int
|
Last update timestamp of device, defaults to None. |
brightness |
int
|
Brightness of bulb (0-100). |
color_temp |
int
|
White color temperature of bulb in percent (0-100). |
color_temp_kelvin |
int
|
White color temperature of bulb in Kelvin. |
color |
Color
|
Color of bulb in the form of a dataclass with two namedtuple
attributes - |
color_mode |
str
|
Color mode of bulb. |
color_modes |
list[str]
|
List of color modes supported by bulb. |
Methods:
Name | Description |
---|---|
update_ts |
Update last update timestamp. |
to_dict |
Dump state to JSON. |
to_json |
Dump state to JSON string. |
to_jsonb |
Dump state to JSON bytes. |
as_tuple |
Convert state to tuple of (name, value) tuples. |
See Also
VeSyncBulb
- [
ResponseDeviceDetailsModel
][ pyvesync.models.device_list_models.ResponseDeviceDetailsModel] BulbMap
Inherited From DeviceState
Initialize device state.
Initialize VeSync Bulb State Base.
Source code in src\pyvesync\base_devices\bulb_base.py
Attributes↲
color_temp
property
writable
↲
White color temperature of bulb in percent (0-100).
color_temp_kelvin
property
↲
Return white color temperature of bulb in Kelvin.
connection_status
instance-attribute
↲
Inherited From DeviceState
device_status
instance-attribute
↲
Inherited From DeviceState
Functions↲
as_tuple ↲
Inherited From DeviceState
Convert state to tuple of (name, value) tuples.
display ↲
Inherited From DeviceState
Print formatted state to stdout.
to_dict ↲
Inherited From DeviceState
Convert state to dictionary.
to_json ↲
Inherited From DeviceState
Dump state to JSON string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
indent
|
bool
|
If True, indent JSON output, defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device state. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From DeviceState
Convert state to JSON bytes.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
update_ts ↲
Inherited From DeviceState
Update last update timestamp.
pyvesync.devices.vesyncbulb.VeSyncBulbESL100 ↲
VeSyncBulbESL100(
details: ResponseDeviceDetailsModel,
manager: VeSync,
feature_map: BulbMap,
)
Bases: BypassV1Mixin
, VeSyncBulb
Object to hold VeSync ESL100 light bulb.
Device state is held in the state
attribute, which is an instance of
BulbState. The state
attribute
contains all settable states for the bulb.
This bulb only has the dimmable feature. Inherits from VeSyncBulb and VeSyncBaseToggleDevice.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
details
|
dict
|
Dictionary of bulb state details. |
required |
manager
|
VeSync
|
Manager class used to make API calls |
required |
feature_map
|
BulbMap
|
Device configuration map. |
required |
Attributes:
Name | Type | Description |
---|---|---|
state |
BulbState
|
Device state object Each device has a separate state base class in the base_devices module. |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
pid |
str
|
Product ID of device, pulled by some devices on update. |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
features |
dict
|
Features of device. |
Inherited From VeSyncBulb
Initialize VeSync device base class.
Initialize VeSync smart bulb base class.
Initialize Etekcity ESL100 Dimmable Bulb.
Source code in src\pyvesync\devices\vesyncbulb.py
Attributes↲
config_module
instance-attribute
↲
Inherited From VeSyncBaseDevice
connection_type
instance-attribute
↲
Inherited From VeSyncBaseDevice
current_firm_version
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_image
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_region
instance-attribute
↲
Inherited From VeSyncBaseDevice
firmware_update
property
↲
Inherited From VeSyncBaseDevice
Return True if firmware update available.
This is going to be updated.
last_response
instance-attribute
↲
last_response: ResponseInfo | None = None
Inherited From VeSyncBaseDevice
request_keys
class-attribute
↲
request_keys: list[str] = [
'acceptLanguage',
'appVersion',
'phoneBrand',
'phoneOS',
'accountID',
'cid',
'configModule',
'debugMode',
'traceId',
'timeZone',
'token',
'userCountryCode',
'uuid',
'configModel',
'deviceId',
]
Inherited From BypassV1Mixin
state
instance-attribute
↲
Inherited From VeSyncBaseDevice
sub_device_no
instance-attribute
↲
Inherited From VeSyncBaseDevice
supports_brightness
property
↲
Inherited From VeSyncBulb
Return True if bulb supports brightness.
Functions↲
call_bypassv1_api
async
↲
call_bypassv1_api(
request_model: type[RequestBypassV1],
update_dict: dict | None = None,
method: str = 'bypass',
endpoint: str = 'bypass',
) -> dict | None
Inherited From BypassV1Mixin
Send ByPass V1 API request.
This uses the _build_request
method to send API requests to the Bypass V1 API.
The endpoint can be overridden with the endpoint
argument.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request_model
|
type[RequestBypassV1]
|
The request model to use. |
required |
update_dict
|
dict
|
Additional keys to add on. |
None
|
method
|
str
|
The method to use in the outer body. |
'bypass'
|
endpoint
|
str | None
|
The last part of the url path, defaults to
|
'bypass'
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
dict | None
|
The response from the API request. |
Source code in src\pyvesync\utils\device_mixins.py
clear_timer
async
↲
Inherited From VeSyncBaseDevice
Clear timer for device from API.
This may not be implemented for all devices. Please open an issue if there is an error.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
display ↲
Inherited From VeSyncBaseDevice
Print formatted static device info to stdout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in display, defaults to True. |
True
|
Example:
Device Name:..................Living Room Lamp
Model:........................ESL100
Subdevice No:.................0
Type:.........................wifi
CID:..........................1234567890abcdef
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
displayJSON
deprecated
↲
Inherited From VeSyncBaseDevice
Deprecated
Use to_json() instead
Return JSON details for device. - Deprecated use to_json().
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
enable_white_mode
async
deprecated
↲
Inherited From VeSyncBulb
Deprecated
Use set_white_mode
instead.
Enable white mode if supported by bulb.
get_details
async
↲
Inherited From VeSyncBaseDevice
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state
attribute. The update()
method should
be called to update the device state.
Source code in src\pyvesync\devices\vesyncbulb.py
get_state ↲
Inherited From VeSyncBaseDevice
Get device state attribute.
get_timer
async
↲
Inherited From VeSyncBaseDevice
Get timer for device from API and set the state.Timer
attribute.
This may not be implemented for all devices. Please open an issue if there is an error.
Note
This method may not be implemented for all devices. Please open an issue if there is an error.
Source code in src\pyvesync\devices\vesyncbulb.py
set_brightness
async
↲
Inherited From VeSyncBulb
Set brightness if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
brightness
|
NUMERIC_T
|
Brightness 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
set_state ↲
Inherited From VeSyncBaseDevice
Set device state attribute.
set_status
async
↲
Set brightness of dimmable bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
brightness
|
int
|
Brightness of bulb (0-100). |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
set_timer
async
↲
Inherited From VeSyncBaseDevice
Set timer for device.
This may not be implemented for all devices. Please open an issue if there is an error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
Duration in seconds. |
required |
action
|
str | None
|
Action to take when timer expires. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
set_white_mode
async
↲
Inherited From VeSyncBulb
Set white mode if supported by bulb.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\bulb_base.py
to_dict ↲
Inherited From VeSyncBaseDevice
Return device information as a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in dictionary, defaults to True. |
True
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: Dictionary containing device information. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_json ↲
Inherited From VeSyncBaseDevice
Print JSON API string for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device details. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From VeSyncBaseDevice
JSON API bytes for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
JSON formatted bytes of device details. |
Example
This is an example without state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
toggle
async
↲
Toggle switch of ESL100 bulb.
Source code in src\pyvesync\devices\vesyncbulb.py
toggle_switch
async
↲
Inherited From VeSyncBaseToggleDevice
Toggle device power on or off.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
True to turn on, False to turn off, None to toggle. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
turn_off
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device off.
turn_on
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device on.
update
async
↲
Inherited From VeSyncBaseDevice
Update device details.
pyvesync.devices.vesyncbulb.VeSyncBulbESL100CW ↲
VeSyncBulbESL100CW(
details: ResponseDeviceDetailsModel,
manager: VeSync,
feature_map: BulbMap,
)
Bases: BypassV1Mixin
, VeSyncBulb
VeSync Tunable and Dimmable White Bulb.
This bulb only has the dimmable feature. Inherits from VeSyncBulb and VeSyncBaseToggleDevice.
Device state is held in the state
attribute, which is an instance of
BulbState. The state
attribute
contains all settable states for the bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
details
|
dict
|
Dictionary of bulb state details. |
required |
manager
|
VeSync
|
Manager class used to make API calls |
required |
feature_map
|
BulbMap
|
Device configuration map. |
required |
Attributes:
Name | Type | Description |
---|---|---|
state |
BulbState
|
Device state object Each device has a separate state base class in the base_devices module. |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
pid |
str
|
Product ID of device, pulled by some devices on update. |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
features |
dict
|
Features of device. |
Inherited From VeSyncBulb
Initialize VeSync device base class.
Initialize VeSync smart bulb base class.
Initialize Etekcity Tunable white bulb.
Source code in src\pyvesync\devices\vesyncbulb.py
Attributes↲
config_module
instance-attribute
↲
Inherited From VeSyncBaseDevice
connection_type
instance-attribute
↲
Inherited From VeSyncBaseDevice
current_firm_version
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_image
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_region
instance-attribute
↲
Inherited From VeSyncBaseDevice
firmware_update
property
↲
Inherited From VeSyncBaseDevice
Return True if firmware update available.
This is going to be updated.
last_response
instance-attribute
↲
last_response: ResponseInfo | None = None
Inherited From VeSyncBaseDevice
request_keys
class-attribute
↲
request_keys: list[str] = [
'acceptLanguage',
'appVersion',
'phoneBrand',
'phoneOS',
'accountID',
'cid',
'configModule',
'debugMode',
'traceId',
'timeZone',
'token',
'userCountryCode',
'uuid',
'configModel',
'deviceId',
]
Inherited From BypassV1Mixin
state
instance-attribute
↲
Inherited From VeSyncBaseDevice
sub_device_no
instance-attribute
↲
Inherited From VeSyncBaseDevice
supports_brightness
property
↲
Inherited From VeSyncBulb
Return True if bulb supports brightness.
Functions↲
call_bypassv1_api
async
↲
call_bypassv1_api(
request_model: type[RequestBypassV1],
update_dict: dict | None = None,
method: str = 'bypass',
endpoint: str = 'bypass',
) -> dict | None
Inherited From BypassV1Mixin
Send ByPass V1 API request.
This uses the _build_request
method to send API requests to the Bypass V1 API.
The endpoint can be overridden with the endpoint
argument.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request_model
|
type[RequestBypassV1]
|
The request model to use. |
required |
update_dict
|
dict
|
Additional keys to add on. |
None
|
method
|
str
|
The method to use in the outer body. |
'bypass'
|
endpoint
|
str | None
|
The last part of the url path, defaults to
|
'bypass'
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
dict | None
|
The response from the API request. |
Source code in src\pyvesync\utils\device_mixins.py
clear_timer
async
↲
Inherited From VeSyncBaseDevice
Clear timer for device from API.
This may not be implemented for all devices. Please open an issue if there is an error.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
display ↲
Inherited From VeSyncBaseDevice
Print formatted static device info to stdout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in display, defaults to True. |
True
|
Example:
Device Name:..................Living Room Lamp
Model:........................ESL100
Subdevice No:.................0
Type:.........................wifi
CID:..........................1234567890abcdef
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
displayJSON
deprecated
↲
Inherited From VeSyncBaseDevice
Deprecated
Use to_json() instead
Return JSON details for device. - Deprecated use to_json().
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
enable_white_mode
async
deprecated
↲
Inherited From VeSyncBulb
Deprecated
Use set_white_mode
instead.
Enable white mode if supported by bulb.
get_details
async
↲
Inherited From VeSyncBaseDevice
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state
attribute. The update()
method should
be called to update the device state.
Source code in src\pyvesync\devices\vesyncbulb.py
get_state ↲
Inherited From VeSyncBaseDevice
Get device state attribute.
get_timer
async
↲
Inherited From VeSyncBaseDevice
Get timer for device from API and set the state.Timer
attribute.
This may not be implemented for all devices. Please open an issue if there is an error.
Note
This method may not be implemented for all devices. Please open an issue if there is an error.
Source code in src\pyvesync\devices\vesyncbulb.py
set_brightness
async
↲
Inherited From VeSyncBulb
Set brightness if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
brightness
|
NUMERIC_T
|
Brightness 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Set brightness of tunable bulb.
set_state ↲
Inherited From VeSyncBaseDevice
Set device state attribute.
set_status
async
↲
Set status of tunable bulb.
Source code in src\pyvesync\devices\vesyncbulb.py
set_timer
async
↲
Inherited From VeSyncBaseDevice
Set timer for device.
This may not be implemented for all devices. Please open an issue if there is an error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
Duration in seconds. |
required |
action
|
str | None
|
Action to take when timer expires. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
set_white_mode
async
↲
Inherited From VeSyncBulb
Set white mode if supported by bulb.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\bulb_base.py
to_dict ↲
Inherited From VeSyncBaseDevice
Return device information as a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in dictionary, defaults to True. |
True
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: Dictionary containing device information. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_json ↲
Inherited From VeSyncBaseDevice
Print JSON API string for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device details. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From VeSyncBaseDevice
JSON API bytes for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
JSON formatted bytes of device details. |
Example
This is an example without state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
toggle
async
↲
Deprecated, use toggle_switch() instead.
Source code in src\pyvesync\devices\vesyncbulb.py
toggle_switch
async
↲
Inherited From VeSyncBaseToggleDevice
Toggle device power on or off.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
True to turn on, False to turn off, None to toggle. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
turn_off
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device off.
turn_on
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device on.
update
async
↲
Inherited From VeSyncBaseDevice
Update device details.
pyvesync.devices.vesyncbulb.VeSyncBulbESL100MC ↲
VeSyncBulbESL100MC(
details: ResponseDeviceDetailsModel,
manager: VeSync,
feature_map: BulbMap,
)
Bases: VeSyncBulb
Etekcity ESL100 Multi Color Bulb device.
Inherits from VeSyncBulb and VeSyncBaseDevice.
The state of the bulb is stored in the state
attribute, which is an of
BulbState. The state
attribute
contains all settable states for the bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
details
|
dict
|
Dictionary of bulb state details. |
required |
manager
|
VeSync
|
Manager class used to make API calls. |
required |
feature_map
|
BulbMap
|
Device configuration map. |
required |
Attributes:
Name | Type | Description |
---|---|---|
state |
BulbState
|
Device state object Each device has a separate state base class in the base_devices module. |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
pid |
str
|
Product ID of device, pulled by some devices on update. |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
features |
dict
|
Features of device. |
Notes
The details dictionary contains the device information retreived by the
update()
method:
Inherited From VeSyncBulb
Initialize VeSync device base class.
Initialize VeSync smart bulb base class.
Instantiate ESL100MC Multicolor Bulb.
Source code in src\pyvesync\devices\vesyncbulb.py
Attributes↲
color_value_hsv
property
↲
color_value_hsv: HSV | None
Inherited From VeSyncBulb
DEPRECATED....use self.state.hsv
.
color_value_rgb
property
↲
color_value_rgb: RGB | None
Inherited From VeSyncBulb
DEPRECATED....use self.state.rgb
.
config_module
instance-attribute
↲
Inherited From VeSyncBaseDevice
connection_type
instance-attribute
↲
Inherited From VeSyncBaseDevice
current_firm_version
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_image
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_region
instance-attribute
↲
Inherited From VeSyncBaseDevice
firmware_update
property
↲
Inherited From VeSyncBaseDevice
Return True if firmware update available.
This is going to be updated.
last_response
instance-attribute
↲
last_response: ResponseInfo | None = None
Inherited From VeSyncBaseDevice
request_keys
instance-attribute
↲
request_keys = [
'acceptLanguage',
'accountID',
'appVersion',
'cid',
'configModule',
'debugMode',
'deviceRegion',
'phoneBrand',
'phoneOS',
'timeZone',
'token',
'traceId',
]
state
instance-attribute
↲
Inherited From VeSyncBaseDevice
sub_device_no
instance-attribute
↲
Inherited From VeSyncBaseDevice
supports_brightness
property
↲
Inherited From VeSyncBulb
Return True if bulb supports brightness.
supports_color_temp
property
↲
Inherited From VeSyncBulb
Return True if bulb supports color temperature.
supports_multicolor
property
↲
Inherited From VeSyncBulb
Return True if bulb supports backlight.
Functions↲
clear_timer
async
↲
Inherited From VeSyncBaseDevice
Clear timer for device from API.
This may not be implemented for all devices. Please open an issue if there is an error.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
display ↲
Inherited From VeSyncBaseDevice
Print formatted static device info to stdout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in display, defaults to True. |
True
|
Example:
Device Name:..................Living Room Lamp
Model:........................ESL100
Subdevice No:.................0
Type:.........................wifi
CID:..........................1234567890abcdef
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
displayJSON
deprecated
↲
Inherited From VeSyncBaseDevice
Deprecated
Use to_json() instead
Return JSON details for device. - Deprecated use to_json().
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
enable_white_mode
async
deprecated
↲
Inherited From VeSyncBulb
Deprecated
Use set_white_mode
instead.
Enable white mode if supported by bulb.
get_details
async
↲
Inherited From VeSyncBaseDevice
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state
attribute. The update()
method should
be called to update the device state.
Source code in src\pyvesync\devices\vesyncbulb.py
get_state ↲
Inherited From VeSyncBaseDevice
Get device state attribute.
get_timer
async
↲
get_timer() -> Timer | None
Inherited From VeSyncBaseDevice
Get timer for device from API and set the state.Timer
attribute.
This may not be implemented for all devices. Please open an issue if there is an error.
Note
This method may not be implemented for all devices. Please open an issue if there is an error.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
set_brightness
async
↲
Inherited From VeSyncBulb
Set brightness if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
brightness
|
NUMERIC_T
|
Brightness 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
set_color_mode
async
↲
Inherited From VeSyncBulb
Set color mode if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_mode
|
str
|
Color mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\bulb_base.py
set_color_temp
async
↲
Inherited From VeSyncBulb
Set color temperature if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_temp
|
int
|
Color temperature 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\bulb_base.py
set_hsv
async
↲
Inherited From VeSyncBulb
Set HSV if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hue
|
float
|
Hue 0-360 |
required |
saturation
|
float
|
Saturation 0-100 |
required |
value
|
float
|
Value 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
set_rgb
async
↲
Inherited From VeSyncBulb
Set RGB if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
red
|
float
|
Red 0-255 |
required |
green
|
float
|
green 0-255 |
required |
blue
|
float
|
blue 0-255 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
set_state ↲
Inherited From VeSyncBaseDevice
Set device state attribute.
set_status
async
↲
set_status(
brightness: float | None = None,
red: float | None = None,
green: float | None = None,
blue: float | None = None,
) -> bool
Set color of VeSync ESL100MC.
Brightness or RGB values must be provided. If RGB values are provided, brightness is ignored.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
brightness
|
float | None
|
Brightness of bulb (0-100). |
None
|
red
|
float | None
|
Red value of RGB color, 0-255. |
None
|
green
|
float | None
|
Green value of RGB color, 0-255. |
None
|
blue
|
float | None
|
Blue value of RGB color, 0-255. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
|
set_timer
async
↲
Inherited From VeSyncBaseDevice
Set timer for device.
This may not be implemented for all devices. Please open an issue if there is an error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
Duration in seconds. |
required |
action
|
str | None
|
Action to take when timer expires. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
set_white_mode
async
↲
Inherited From VeSyncBulb
Set white mode if supported by bulb.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
to_dict ↲
Inherited From VeSyncBaseDevice
Return device information as a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in dictionary, defaults to True. |
True
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: Dictionary containing device information. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_json ↲
Inherited From VeSyncBaseDevice
Print JSON API string for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device details. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From VeSyncBaseDevice
JSON API bytes for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
JSON formatted bytes of device details. |
Example
This is an example without state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
toggle
async
↲
Toggle switch of VeSync ESL100MC.
Source code in src\pyvesync\devices\vesyncbulb.py
toggle_switch
async
↲
Inherited From VeSyncBaseToggleDevice
Toggle device power on or off.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
True to turn on, False to turn off, None to toggle. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
turn_off
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device off.
turn_on
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device on.
update
async
↲
Inherited From VeSyncBaseDevice
Update device details.
pyvesync.devices.vesyncbulb.VeSyncBulbValcenoA19MC ↲
VeSyncBulbValcenoA19MC(
details: ResponseDeviceDetailsModel,
manager: VeSync,
feature_map: BulbMap,
)
Bases: VeSyncBulb
VeSync Multicolor Bulb.
This bulb only has the dimmable feature. Inherits from VeSyncBulb and VeSyncBaseToggleDevice.
Device state is held in the state
attribute, which is an instance of
BulbState. The state
attribute
contains all settable states for the bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
details
|
dict
|
Dictionary of bulb state details. |
required |
manager
|
VeSync
|
Manager class used to make API calls |
required |
feature_map
|
BulbMap
|
Device configuration map. |
required |
Attributes:
Name | Type | Description |
---|---|---|
state |
BulbState
|
Device state object Each device has a separate state base class in the base_devices module. |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
pid |
str
|
Product ID of device, pulled by some devices on update. |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
features |
dict
|
Features of device. |
Inherited From VeSyncBulb
Initialize VeSync device base class.
Initialize VeSync smart bulb base class.
Initialize Multicolor bulb.
Source code in src\pyvesync\devices\vesyncbulb.py
Attributes↲
color_value_hsv
property
↲
color_value_hsv: HSV | None
Inherited From VeSyncBulb
DEPRECATED....use self.state.hsv
.
color_value_rgb
property
↲
color_value_rgb: RGB | None
Inherited From VeSyncBulb
DEPRECATED....use self.state.rgb
.
config_module
instance-attribute
↲
Inherited From VeSyncBaseDevice
connection_type
instance-attribute
↲
Inherited From VeSyncBaseDevice
current_firm_version
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_image
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_region
instance-attribute
↲
Inherited From VeSyncBaseDevice
firmware_update
property
↲
Inherited From VeSyncBaseDevice
Return True if firmware update available.
This is going to be updated.
last_response
instance-attribute
↲
last_response: ResponseInfo | None = None
Inherited From VeSyncBaseDevice
request_keys
instance-attribute
↲
request_keys = [
'acceptLanguage',
'accountID',
'appVersion',
'cid',
'configModule',
'deviceRegion',
'debugMode',
'phoneBrand',
'phoneOS',
'timeZone',
'token',
'traceId',
]
state
instance-attribute
↲
Inherited From VeSyncBaseDevice
sub_device_no
instance-attribute
↲
Inherited From VeSyncBaseDevice
supports_brightness
property
↲
Inherited From VeSyncBulb
Return True if bulb supports brightness.
supports_color_temp
property
↲
Inherited From VeSyncBulb
Return True if bulb supports color temperature.
supports_multicolor
property
↲
Inherited From VeSyncBulb
Return True if bulb supports backlight.
Functions↲
clear_timer
async
↲
Inherited From VeSyncBaseDevice
Clear timer for device from API.
This may not be implemented for all devices. Please open an issue if there is an error.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
display ↲
Inherited From VeSyncBaseDevice
Print formatted static device info to stdout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in display, defaults to True. |
True
|
Example:
Device Name:..................Living Room Lamp
Model:........................ESL100
Subdevice No:.................0
Type:.........................wifi
CID:..........................1234567890abcdef
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
displayJSON
deprecated
↲
Inherited From VeSyncBaseDevice
Deprecated
Use to_json() instead
Return JSON details for device. - Deprecated use to_json().
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
enable_white_mode
async
deprecated
↲
Inherited From VeSyncBulb
Deprecated
Use set_white_mode
instead.
Enable white mode if supported by bulb.
get_details
async
↲
Inherited From VeSyncBaseDevice
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state
attribute. The update()
method should
be called to update the device state.
Source code in src\pyvesync\devices\vesyncbulb.py
get_state ↲
Inherited From VeSyncBaseDevice
Get device state attribute.
get_timer
async
↲
get_timer() -> Timer | None
Inherited From VeSyncBaseDevice
Get timer for device from API and set the state.Timer
attribute.
This may not be implemented for all devices. Please open an issue if there is an error.
Note
This method may not be implemented for all devices. Please open an issue if there is an error.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
set_brightness
async
↲
Inherited From VeSyncBulb
Set brightness if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
brightness
|
NUMERIC_T
|
Brightness 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Set brightness of multicolor bulb.
set_color_hue
async
↲
set_color_mode
async
↲
Inherited From VeSyncBulb
Set color mode if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_mode
|
str
|
Color mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Set Color Mode of Bulb (white / hsv).
set_color_saturation
async
↲
set_color_temp
async
↲
Inherited From VeSyncBulb
Set color temperature if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_temp
|
int
|
Color temperature 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Set White Temperature of Bulb in pct (0 - 100).
set_color_value
async
↲
Set Value of multicolor bulb in pct (1 - 100).
set_hsv
async
↲
Inherited From VeSyncBulb
Set HSV if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hue
|
float
|
Hue 0-360 |
required |
saturation
|
float
|
Saturation 0-100 |
required |
value
|
float
|
Value 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
set_rgb
async
↲
Inherited From VeSyncBulb
Set RGB if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
red
|
float
|
Red 0-255 |
required |
green
|
float
|
green 0-255 |
required |
blue
|
float
|
blue 0-255 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
set_state ↲
Inherited From VeSyncBaseDevice
Set device state attribute.
set_status
async
↲
set_status(
*,
brightness: float | None = None,
color_temp: float | None = None,
color_hue: float | None = None,
color_saturation: float | None = None,
color_value: float | None = None,
color_mode: str | None = None,
) -> bool
Set multicolor bulb parameters.
No arguments turns bulb on. Kwargs only
Parameters:
Name | Type | Description | Default |
---|---|---|---|
brightness
|
int
|
brightness between 0 and 100 |
None
|
color_temp
|
int
|
color temperature between 0 and 100 |
None
|
color_mode
|
int
|
color mode hsv or white |
None
|
color_hue
|
float
|
color hue between 0 and 360 |
None
|
color_saturation
|
float
|
color saturation between 0 and 100 |
None
|
color_value
|
int
|
color value between 0 and 100 |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if call was successful, False otherwise |
Source code in src\pyvesync\devices\vesyncbulb.py
set_timer
async
↲
Inherited From VeSyncBaseDevice
Set timer for device.
This may not be implemented for all devices. Please open an issue if there is an error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
Duration in seconds. |
required |
action
|
str | None
|
Action to take when timer expires. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
set_white_mode
async
↲
Inherited From VeSyncBulb
Set white mode if supported by bulb.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
to_dict ↲
Inherited From VeSyncBaseDevice
Return device information as a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in dictionary, defaults to True. |
True
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: Dictionary containing device information. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_json ↲
Inherited From VeSyncBaseDevice
Print JSON API string for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device details. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From VeSyncBaseDevice
JSON API bytes for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
JSON formatted bytes of device details. |
Example
This is an example without state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
toggle
async
↲
Deprecated, use toggle_switch() instead.
Source code in src\pyvesync\devices\vesyncbulb.py
toggle_switch
async
↲
Inherited From VeSyncBaseToggleDevice
Toggle device power on or off.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
True to turn on, False to turn off, None to toggle. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\devices\vesyncbulb.py
turn_off
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device off.
turn_on
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device on.
update
async
↲
Inherited From VeSyncBaseDevice
Update device details.
pyvesync.base_devices.bulb_base.VeSyncBulb ↲
VeSyncBulb(
details: ResponseDeviceDetailsModel,
manager: VeSync,
feature_map: BulbMap,
)
Bases: VeSyncBaseToggleDevice[BulbState]
Base class for VeSync Bulbs.
Abstract base class to provide methods for controlling and
getting details of VeSync bulbs. Inherits from
VeSyncBaseDevice
. This
class should not be used directly for devices, but rather subclassed for each bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
details
|
ResponseDeviceDetailsModel
|
Device details from API. |
required |
manager
|
VeSync
|
VeSync API manager. |
required |
feature_map
|
BulbMap
|
Feature map for bulb. |
required |
Attributes:
Name | Type | Description |
---|---|---|
state |
BulbState
|
Device state object Each device has a separate state base class in the base_devices module. |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
pid |
str
|
Product ID of device, pulled by some devices on update. |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
features |
dict
|
Features of device. |
Inherited From VeSyncBaseDevice
Initialize VeSync device base class.
Initialize VeSync smart bulb base class.
Source code in src\pyvesync\base_devices\bulb_base.py
Attributes↲
color_value_hsv
property
↲
color_value_hsv: HSV | None
Inherited From VeSyncBulb
DEPRECATED....use self.state.hsv
.
color_value_rgb
property
↲
color_value_rgb: RGB | None
Inherited From VeSyncBulb
DEPRECATED....use self.state.rgb
.
config_module
instance-attribute
↲
Inherited From VeSyncBaseDevice
connection_type
instance-attribute
↲
Inherited From VeSyncBaseDevice
current_firm_version
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_image
instance-attribute
↲
Inherited From VeSyncBaseDevice
device_region
instance-attribute
↲
Inherited From VeSyncBaseDevice
firmware_update
property
↲
Inherited From VeSyncBaseDevice
Return True if firmware update available.
This is going to be updated.
last_response
instance-attribute
↲
last_response: ResponseInfo | None = None
Inherited From VeSyncBaseDevice
state
instance-attribute
↲
Inherited From VeSyncBaseDevice
sub_device_no
instance-attribute
↲
Inherited From VeSyncBaseDevice
supports_brightness
property
↲
Inherited From VeSyncBulb
Return True if bulb supports brightness.
supports_color_temp
property
↲
Inherited From VeSyncBulb
Return True if bulb supports color temperature.
supports_multicolor
property
↲
Inherited From VeSyncBulb
Return True if bulb supports backlight.
Functions↲
clear_timer
async
↲
Inherited From VeSyncBaseDevice
Clear timer for device from API.
This may not be implemented for all devices. Please open an issue if there is an error.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
display ↲
Inherited From VeSyncBaseDevice
Print formatted static device info to stdout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in display, defaults to True. |
True
|
Example:
Device Name:..................Living Room Lamp
Model:........................ESL100
Subdevice No:.................0
Type:.........................wifi
CID:..........................1234567890abcdef
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
displayJSON
deprecated
↲
Inherited From VeSyncBaseDevice
Deprecated
Use to_json() instead
Return JSON details for device. - Deprecated use to_json().
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
enable_white_mode
async
deprecated
↲
Inherited From VeSyncBulb
Deprecated
Use set_white_mode
instead.
Enable white mode if supported by bulb.
get_details
abstractmethod
async
↲
Inherited From VeSyncBaseDevice
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state
attribute. The update()
method should
be called to update the device state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
get_state ↲
Inherited From VeSyncBaseDevice
Get device state attribute.
get_timer
async
↲
get_timer() -> Timer | None
Inherited From VeSyncBaseDevice
Get timer for device from API and set the state.Timer
attribute.
This may not be implemented for all devices. Please open an issue if there is an error.
Note
This method may not be implemented for all devices. Please open an issue if there is an error.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
set_brightness
async
↲
Set brightness if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
brightness
|
NUMERIC_T
|
Brightness 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\bulb_base.py
set_color_mode
async
↲
Inherited From VeSyncBulb
Set color mode if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_mode
|
str
|
Color mode to set. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\bulb_base.py
set_color_temp
async
↲
Inherited From VeSyncBulb
Set color temperature if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_temp
|
int
|
Color temperature 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\bulb_base.py
set_hsv
async
↲
Inherited From VeSyncBulb
Set HSV if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hue
|
float
|
Hue 0-360 |
required |
saturation
|
float
|
Saturation 0-100 |
required |
value
|
float
|
Value 0-100 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\bulb_base.py
set_rgb
async
↲
Inherited From VeSyncBulb
Set RGB if supported by bulb.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
red
|
float
|
Red 0-255 |
required |
green
|
float
|
green 0-255 |
required |
blue
|
float
|
blue 0-255 |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\bulb_base.py
set_state ↲
Inherited From VeSyncBaseDevice
Set device state attribute.
set_timer
async
↲
Inherited From VeSyncBaseDevice
Set timer for device.
This may not be implemented for all devices. Please open an issue if there is an error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
Duration in seconds. |
required |
action
|
str | None
|
Action to take when timer expires. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
set_white_mode
async
↲
Inherited From VeSyncBulb
Set white mode if supported by bulb.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\bulb_base.py
to_dict ↲
Inherited From VeSyncBaseDevice
Return device information as a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in dictionary, defaults to True. |
True
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: Dictionary containing device information. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_json ↲
Inherited From VeSyncBaseDevice
Print JSON API string for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
JSON formatted string of device details. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
to_jsonb ↲
Inherited From VeSyncBaseDevice
JSON API bytes for device details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
bool
|
If True, include state in JSON output, defaults to True. |
True
|
indent
|
bool
|
If True, indent JSON output, defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
JSON formatted bytes of device details. |
Example
This is an example without state.
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
toggle_switch
abstractmethod
async
↲
Inherited From VeSyncBaseToggleDevice
Toggle device power on or off.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toggle
|
bool | None
|
True to turn on, False to turn off, None to toggle. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src\pyvesync\base_devices\vesyncbasedevice.py
turn_off
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device off.
turn_on
async
↲
Inherited From VeSyncBaseToggleDevice
Turn device on.
update
async
↲
Inherited From VeSyncBaseDevice
Update device details.