Add new action for TM1651 (#442)

* Add new action for TM1651

* Add turn_on and turn_off actions

* Fixed title

* Update components/tm1651.rst

* Update components/tm1651.rst

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
Evgeny 2020-02-24 15:57:51 +01:00 committed by GitHub
parent 69b39e06cf
commit 4a251f33af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,6 +32,26 @@ Configuration variables:
- **dio_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): DIO pin
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
.. _tm1651-set_level_percent_action:
``tm1651.set_level_percent`` Action
-----------------------------------
This :ref:`Action <config-action>` changes the level of the battery display at runtime.
Automatically calculates input level in percentages to actual level for the display.
.. code-block:: yaml
on_...:
- tm1651.set_level_percent:
id: tm1651_battery
level_percent: 50
Configuration variables:
- **id** (**Required**, :ref:`config-id`): The ID of the TM1651.
- **level_percent** (**Required**, :ref:`templatable <config-templatable>`, int): Level from 0 to 100
.. _tm1651-set_level_action:
``tm1651.set_level`` Action
@ -44,12 +64,12 @@ This :ref:`Action <config-action>` changes the level of the battery display at r
on_...:
- tm1651.set_level:
id: tm1651_battery
level: 50
level: 5
Configuration variables:
- **id** (**Required**, :ref:`config-id`): The ID of the TM1651.
- **level** (**Required**, :ref:`templatable <config-templatable>`, int): Level from 9 to 100
- **level** (**Required**, :ref:`templatable <config-templatable>`, int): Level from 0 to 7
.. _tm1651-set_brightness_action:
@ -71,6 +91,40 @@ Configuration variables:
- **brightness** (**Required**, :ref:`templatable <config-templatable>`, int): There is three levels of brightness
(``1``, ``2`` or ``3``) from lowest to highest brightness.
.. _tm1651-turn_off:
``tm1651.turn_off`` Action
--------------------------
This :ref:`Action <config-action>` turns off all the LEDs.
.. code-block:: yaml
on_...:
- tm1651.turn_off:
id: tm1651_battery
Configuration variables:
- **id** (**Required**, :ref:`config-id`): The ID of the TM1651.
.. _tm1651-turn_on:
``tm1651.turn_on`` Action
-------------------------
This :ref:`Action <config-action>` turns on the LEDs.
.. code-block:: yaml
on_...:
- tm1651.turn_on:
id: tm1651_battery
Configuration variables:
- **id** (**Required**, :ref:`config-id`): The ID of the TM1651.
Advanced Configuration
----------------------