Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.yeelight.device.YeelightDevice Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, str host, dict[str, Any] config, AsyncBulb bulb)
 
def async_mark_unavailable (self)
 
def async_setup (self)
 
def async_update (self, force=False)
 
def async_update_callback (self, data)
 
def available (self)
 
def bulb (self)
 
def config (self)
 
def fw_version (self)
 
def host (self)
 
bool is_color_flow_enabled (self)
 
bool is_nightlight_enabled (self)
 
bool is_nightlight_supported (self)
 
def model (self)
 
def name (self)
 
def type (self)
 
str|None unique_id (self)
 

Public Attributes

 capabilities
 

Private Member Functions

def _active_mode (self)
 
def _async_forced_update (self, _now)
 
def _async_update_properties (self)
 
def _color_flow (self)
 
def _nightlight_brightness (self)
 

Private Attributes

 _available
 
 _bulb_device
 
 _config
 
 _device_type
 
 _hass
 
 _host
 
 _initialized
 
 _name
 

Detailed Description

Represents single Yeelight device.

Definition at line 64 of file device.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.yeelight.device.YeelightDevice.__init__ (   self,
HomeAssistant  hass,
str  host,
dict[str, Any]  config,
AsyncBulb   bulb 
)
Initialize device.

Definition at line 67 of file device.py.

Member Function Documentation

◆ _active_mode()

def homeassistant.components.yeelight.device.YeelightDevice._active_mode (   self)
private

Definition at line 153 of file device.py.

◆ _async_forced_update()

def homeassistant.components.yeelight.device.YeelightDevice._async_forced_update (   self,
  _now 
)
private
Call a forced update.

Definition at line 222 of file device.py.

◆ _async_update_properties()

def homeassistant.components.yeelight.device.YeelightDevice._async_update_properties (   self)
private
Read new properties from the device.

Definition at line 172 of file device.py.

◆ _color_flow()

def homeassistant.components.yeelight.device.YeelightDevice._color_flow (   self)
private

Definition at line 157 of file device.py.

◆ _nightlight_brightness()

def homeassistant.components.yeelight.device.YeelightDevice._nightlight_brightness (   self)
private

Definition at line 161 of file device.py.

◆ async_mark_unavailable()

def homeassistant.components.yeelight.device.YeelightDevice.async_mark_unavailable (   self)
Set unavailable on api call failure due to a network issue.

Definition at line 107 of file device.py.

◆ async_setup()

def homeassistant.components.yeelight.device.YeelightDevice.async_setup (   self)
Fetch capabilities and setup name if available.

Definition at line 197 of file device.py.

◆ async_update()

def homeassistant.components.yeelight.device.YeelightDevice.async_update (   self,
  force = False 
)
Update device properties and send data updated signal.

Definition at line 214 of file device.py.

◆ async_update_callback()

def homeassistant.components.yeelight.device.YeelightDevice.async_update_callback (   self,
  data 
)
Update push from device.

Definition at line 227 of file device.py.

◆ available()

def homeassistant.components.yeelight.device.YeelightDevice.available (   self)
Return true is device is available.

Definition at line 102 of file device.py.

◆ bulb()

def homeassistant.components.yeelight.device.YeelightDevice.bulb (   self)
Return bulb device.

Definition at line 82 of file device.py.

◆ config()

def homeassistant.components.yeelight.device.YeelightDevice.config (   self)
Return device config.

Definition at line 92 of file device.py.

◆ fw_version()

def homeassistant.components.yeelight.device.YeelightDevice.fw_version (   self)
Return the firmware version.

Definition at line 117 of file device.py.

◆ host()

def homeassistant.components.yeelight.device.YeelightDevice.host (   self)
Return hostname.

Definition at line 97 of file device.py.

◆ is_color_flow_enabled()

bool homeassistant.components.yeelight.device.YeelightDevice.is_color_flow_enabled (   self)
Return true / false if color flow is currently running.

Definition at line 148 of file device.py.

◆ is_nightlight_enabled()

bool homeassistant.components.yeelight.device.YeelightDevice.is_nightlight_enabled (   self)
Return true / false if nightlight is currently enabled.

Definition at line 135 of file device.py.

◆ is_nightlight_supported()

bool homeassistant.components.yeelight.device.YeelightDevice.is_nightlight_supported (   self)
Return true / false if nightlight is supported.

Uses brightness as it appears to be supported in both ceiling and other lights.

Definition at line 127 of file device.py.

◆ model()

def homeassistant.components.yeelight.device.YeelightDevice.model (   self)
Return configured/autodetected device model.

Definition at line 112 of file device.py.

◆ name()

def homeassistant.components.yeelight.device.YeelightDevice.name (   self)
Return the name of the device if any.

Definition at line 87 of file device.py.

◆ type()

def homeassistant.components.yeelight.device.YeelightDevice.type (   self)
Return bulb type.

Definition at line 165 of file device.py.

◆ unique_id()

str | None homeassistant.components.yeelight.device.YeelightDevice.unique_id (   self)
Return the unique ID of the device.

Definition at line 122 of file device.py.

Member Data Documentation

◆ _available

homeassistant.components.yeelight.device.YeelightDevice._available
private

Definition at line 77 of file device.py.

◆ _bulb_device

homeassistant.components.yeelight.device.YeelightDevice._bulb_device
private

Definition at line 74 of file device.py.

◆ _config

homeassistant.components.yeelight.device.YeelightDevice._config
private

Definition at line 72 of file device.py.

◆ _device_type

homeassistant.components.yeelight.device.YeelightDevice._device_type
private

Definition at line 168 of file device.py.

◆ _hass

homeassistant.components.yeelight.device.YeelightDevice._hass
private

Definition at line 71 of file device.py.

◆ _host

homeassistant.components.yeelight.device.YeelightDevice._host
private

Definition at line 73 of file device.py.

◆ _initialized

homeassistant.components.yeelight.device.YeelightDevice._initialized
private

Definition at line 78 of file device.py.

◆ _name

homeassistant.components.yeelight.device.YeelightDevice._name
private

Definition at line 205 of file device.py.

◆ capabilities

homeassistant.components.yeelight.device.YeelightDevice.capabilities

Definition at line 200 of file device.py.


The documentation for this class was generated from the following file: