mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 22:24:26 +00:00
Add support for TM1638 Led and Key component (#3340)
This commit is contained in:
133
tests/test5.yaml
133
tests/test5.yaml
@@ -80,6 +80,91 @@ binary_sensor:
|
||||
bitmask: 0x80 # (bit 8)
|
||||
lambda: "return x;"
|
||||
|
||||
- platform: tm1638
|
||||
id: Button0
|
||||
key: 0
|
||||
filters:
|
||||
- delayed_on: 10ms
|
||||
on_press:
|
||||
then:
|
||||
- switch.turn_on: Led0
|
||||
on_release:
|
||||
then:
|
||||
- switch.turn_off: Led0
|
||||
|
||||
- platform: tm1638
|
||||
id: Button1
|
||||
key: 1
|
||||
on_press:
|
||||
then:
|
||||
- switch.turn_on: Led1
|
||||
on_release:
|
||||
then:
|
||||
- switch.turn_off: Led1
|
||||
|
||||
- platform: tm1638
|
||||
id: Button2
|
||||
key: 2
|
||||
on_press:
|
||||
then:
|
||||
- switch.turn_on: Led2
|
||||
on_release:
|
||||
then:
|
||||
- switch.turn_off: Led2
|
||||
|
||||
- platform: tm1638
|
||||
id: Button3
|
||||
key: 3
|
||||
on_press:
|
||||
then:
|
||||
- switch.turn_on: Led3
|
||||
on_release:
|
||||
then:
|
||||
- switch.turn_off: Led3
|
||||
|
||||
- platform: tm1638
|
||||
id: Button4
|
||||
key: 4
|
||||
on_press:
|
||||
then:
|
||||
- output.turn_on: Led4
|
||||
on_release:
|
||||
then:
|
||||
- output.turn_off: Led4
|
||||
|
||||
- platform: tm1638
|
||||
id: Button5
|
||||
key: 5
|
||||
on_press:
|
||||
then:
|
||||
- output.turn_on: Led5
|
||||
on_release:
|
||||
then:
|
||||
- output.turn_off: Led5
|
||||
|
||||
- platform: tm1638
|
||||
id: Button6
|
||||
key: 6
|
||||
on_press:
|
||||
then:
|
||||
- output.turn_on: Led6
|
||||
on_release:
|
||||
then:
|
||||
- output.turn_off: Led6
|
||||
|
||||
- platform: tm1638
|
||||
id: Button7
|
||||
key: 7
|
||||
on_press:
|
||||
then:
|
||||
- output.turn_on: Led7
|
||||
on_release:
|
||||
then:
|
||||
- output.turn_off: Led7
|
||||
|
||||
|
||||
|
||||
|
||||
tlc5947:
|
||||
data_pin: GPIO12
|
||||
clock_pin: GPIO14
|
||||
@@ -106,6 +191,22 @@ output:
|
||||
address: 0x9001
|
||||
value_type: U_WORD
|
||||
|
||||
- platform: tm1638
|
||||
id: Led4
|
||||
led: 4
|
||||
|
||||
- platform: tm1638
|
||||
id: Led5
|
||||
led: 5
|
||||
|
||||
- platform: tm1638
|
||||
id: Led6
|
||||
led: 6
|
||||
|
||||
- platform: tm1638
|
||||
id: Led7
|
||||
led: 7
|
||||
|
||||
demo:
|
||||
|
||||
esp32_ble:
|
||||
@@ -354,3 +455,35 @@ switch:
|
||||
register_type: coil
|
||||
address: 2
|
||||
bitmask: 1
|
||||
|
||||
- platform: tm1638
|
||||
id: Led0
|
||||
led: 0
|
||||
name: TM1638Led0
|
||||
|
||||
- platform: tm1638
|
||||
id: Led1
|
||||
led: 1
|
||||
name: TM1638Led1
|
||||
|
||||
- platform: tm1638
|
||||
id: Led2
|
||||
led: 2
|
||||
name: TM1638Led2
|
||||
|
||||
- platform: tm1638
|
||||
id: Led3
|
||||
led: 3
|
||||
name: TM1638Led3
|
||||
|
||||
display:
|
||||
- platform: tm1638
|
||||
id: primarydisplay
|
||||
stb_pin: 5 #TM1638 STB
|
||||
clk_pin: 18 #TM1638 CLK
|
||||
dio_pin: 23 #TM1638 DIO
|
||||
update_interval: 5s
|
||||
intensity: 5
|
||||
lambda: |-
|
||||
it.print("81818181");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user