mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-13 20:36:29 +00:00
Rename Light to LightEntity (#477)
* Rename Light to LightEntity * Add link to base class * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
4d70f3424e
commit
ff435a269f
@ -4,7 +4,7 @@ sidebar_label: Light
|
||||
---
|
||||
|
||||
|
||||
A light entity is a device that controls the brightness, RGB value,color temperature and effects of a light source.
|
||||
A light entity controls the brightness, hue and saturation color value, white value, color temperature and effects of a light source. Derive platform entities from [`homeassistant.components.light.LightEntity`](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/light/__init__.py).
|
||||
|
||||
## Properties
|
||||
|
||||
@ -38,7 +38,7 @@ A light entity is a device that controls the brightness, RGB value,color tempera
|
||||
# Turn on Light Device
|
||||
|
||||
```python
|
||||
class MyLightDevice(LightDevice):
|
||||
class MyLightEntity(LightEntity):
|
||||
def turn_on(self, **kwargs):
|
||||
"""Turn the device on."""
|
||||
|
||||
@ -49,7 +49,7 @@ class MyLightDevice(LightDevice):
|
||||
# Turn Off Light Device
|
||||
|
||||
```python
|
||||
class MyLightDevice(LightDevice):
|
||||
class MyLightEntity(LightEntity):
|
||||
def turn_off(self, **kwargs):
|
||||
"""Turn the device off."""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user