esphome-docs/api/light/index.rst

73 lines
1.5 KiB
ReStructuredText
Raw Normal View History

2018-05-13 11:37:02 +02:00
Light
=====
.. cpp:namespace:: light
Lights in esphomelib are implemented like fans. Both the hardware and the MQTT frontend
access a combined :cpp:class:`LightState` object and use only that to set state and receive
state updates.
2018-05-14 21:15:49 +02:00
.. toctree::
:glob:
*
2018-05-14 21:15:49 +02:00
2018-05-13 11:37:02 +02:00
Example Usage
-------------
.. code-block:: cpp
// Binary
App.make_binary_light("Desk Lamp", App.make_gpio_output(15));
// Brightness-only
App.make_monochromatic_light("Kitchen Lights", App.make_ledc_output(16));
// RGB, see output for information how to setup individual channels.
App.make_rgb_light("RGB Lights", red, green, blue);
App.make_rgbw_light("RGBW Lights", red, green, blue, white);
2018-05-14 21:15:49 +02:00
.. cpp:namespace:: nullptr
2018-05-13 11:37:02 +02:00
See :cpp:func:`Application::make_binary_light`, :cpp:func:`Application::make_monochromatic_light`,
:cpp:func:`Application::make_rgb_light`, :cpp:func:`Application::make_rgbw_light`.
API Reference
-------------
.. cpp:namespace:: nullptr
LightColorValues
****************
2019-01-06 18:56:14 +01:00
.. doxygenfile:: esphomelib/light/light_color_values.h
2018-05-13 11:37:02 +02:00
LightEffect
***********
2019-01-06 18:56:14 +01:00
.. doxygenfile:: esphomelib/light/light_effect.h
2018-05-14 22:10:34 +02:00
2018-05-13 11:37:02 +02:00
LightOutput
***********
2019-01-06 18:56:14 +01:00
.. doxygenfile:: esphomelib/light/light_output.h
2018-05-14 22:10:34 +02:00
2018-05-13 11:37:02 +02:00
LightState
**********
2019-01-06 18:56:14 +01:00
.. doxygenfile:: esphomelib/light/light_state.h
2018-05-13 11:37:02 +02:00
LightTraits
***********
2019-01-06 18:56:14 +01:00
.. doxygenfile:: esphomelib/light/light_traits.h
2018-05-13 11:37:02 +02:00
LightTransformer
****************
2019-01-06 18:56:14 +01:00
.. doxygenfile:: esphomelib/light/light_transformer.h
2018-05-13 11:37:02 +02:00
MQTTJSONLightComponent
**********************
2019-01-06 18:56:14 +01:00
.. doxygenfile:: esphomelib/light/mqtt_json_light_component.h