mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-25 17:17:54 +01:00
Add TM1651 docs (#429)
* Add TM1651 docs * updated gitignore * Fixed title underline * Fixed title length * Moved docs, added actions * fix gitignore * fix indent
This commit is contained in:
parent
c9ed4ad6d4
commit
05626a6a0d
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,3 +4,6 @@ _build
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
|
|
||||||
|
.idea
|
||||||
|
venv
|
||||||
|
BIN
components/images/tm1651-battery-display.jpg
Normal file
BIN
components/images/tm1651-battery-display.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 115 KiB |
101
components/tm1651.rst
Normal file
101
components/tm1651.rst
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
TM1651 Battery Display
|
||||||
|
======================
|
||||||
|
|
||||||
|
.. seo::
|
||||||
|
:description: Instructions for setting up TM1651 Battery Display.
|
||||||
|
:image: tm1651_battery_display.jpg
|
||||||
|
|
||||||
|
.. _tm1651:
|
||||||
|
|
||||||
|
Battery Display
|
||||||
|
---------------
|
||||||
|
|
||||||
|
The ``tm1651`` display platform allows you to use battery display units based on TM1651 chip, like
|
||||||
|
`this one <https://aliexpress.com/item/32811491559.html>`__
|
||||||
|
with ESPHome. Currently integration supports level and brightness setting. All updates can be made via lambda expressions.
|
||||||
|
|
||||||
|
.. figure:: images/tm1651-battery-display.jpg
|
||||||
|
:align: center
|
||||||
|
:width: 70.0%
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
display:
|
||||||
|
- platform: tm1651
|
||||||
|
id: tm1651_battery
|
||||||
|
clk_pin: D6
|
||||||
|
dio_pin: D5
|
||||||
|
|
||||||
|
Configuration variables:
|
||||||
|
************************
|
||||||
|
|
||||||
|
- **clk_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): CLK pin
|
||||||
|
- **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_action:
|
||||||
|
|
||||||
|
``tm1651.set_level`` Action
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
This :ref:`Action <config-action>` changes the level of the battery display at runtime.
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
on_...:
|
||||||
|
- tm1651.set_level:
|
||||||
|
id: tm1651_battery
|
||||||
|
level: 50
|
||||||
|
|
||||||
|
Configuration variables:
|
||||||
|
|
||||||
|
- **id** (**Required**, :ref:`config-id`): The ID of the TM1651.
|
||||||
|
- **level** (**Required**, :ref:`templatable <config-templatable>`, int): Level from 9 to 100
|
||||||
|
|
||||||
|
.. _tm1651-set_brightness_action:
|
||||||
|
|
||||||
|
``tm1651.set_brightness`` Action
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
This :ref:`Action <config-action>` allows you to manually change the brightness of the battery display at runtime.
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
on_...:
|
||||||
|
- tm1651.set_brightness:
|
||||||
|
id: tm1651_battery
|
||||||
|
brightness: 1
|
||||||
|
|
||||||
|
Configuration variables:
|
||||||
|
|
||||||
|
- **id** (**Required**, :ref:`config-id`): The ID of the TM1651.
|
||||||
|
- **brightness** (**Required**, :ref:`templatable <config-templatable>`, int): There is three levels of brightness
|
||||||
|
(``1``, ``2`` or ``3``) from lowest to highest brightness.
|
||||||
|
|
||||||
|
Advanced Configuration
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
You also can control this component with lambda expressions
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
api:
|
||||||
|
services:
|
||||||
|
- service: battery_level
|
||||||
|
variables:
|
||||||
|
level: int
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
id(tm1651_battery).set_level(level);
|
||||||
|
- service: battery_brightness
|
||||||
|
variables:
|
||||||
|
brightness: int
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
id(tm1651_battery).set_brightness(brightness);
|
||||||
|
|
||||||
|
See Also
|
||||||
|
--------
|
||||||
|
|
||||||
|
- :doc:`index`
|
||||||
|
- :ghedit:`Edit`
|
BIN
images/tm1651_battery_display.jpg
Normal file
BIN
images/tm1651_battery_display.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
@ -327,6 +327,7 @@ Misc Components
|
|||||||
DFPlayer, components/dfplayer, dfplayer.svg
|
DFPlayer, components/dfplayer, dfplayer.svg
|
||||||
Captive Portal, components/captive_portal, wifi-strength-alert-outline.svg
|
Captive Portal, components/captive_portal, wifi-strength-alert-outline.svg
|
||||||
Debug Component, components/debug, bug-report.svg
|
Debug Component, components/debug, bug-report.svg
|
||||||
|
TM1651 Battery Display, components/tm1651, tm1651_battery_display.jpg
|
||||||
|
|
||||||
Additional Custom Components
|
Additional Custom Components
|
||||||
----------------------------
|
----------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user