1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-11 22:33:49 +01:00

make cwww, hbridge groupable

This commit is contained in:
J. Nick Koston
2025-10-09 15:42:51 -10:00
parent 0771c04b3c
commit e39ee807cf
10 changed files with 52 additions and 36 deletions

View File

@@ -1,11 +1,3 @@
output:
- platform: ${light_platform}
id: light_output_1
pin: ${pin_o1}
- platform: ${light_platform}
id: light_output_2
pin: ${pin_o2}
light:
- platform: cwww
name: CWWW Light

View File

@@ -3,12 +3,15 @@ substitutions:
pin_o1: GPIO6
pin_o2: GPIO7
packages:
device_base: !include common.yaml
output:
- id: !extend light_output_1
- platform: ${light_platform}
id: light_output_1
pin: ${pin_o1}
channel: 0
- id: !extend light_output_2
- platform: ${light_platform}
id: light_output_2
pin: ${pin_o2}
channel: 1
phase_angle: 180°
<<: !include common.yaml

View File

@@ -3,12 +3,15 @@ substitutions:
pin_o1: GPIO16
pin_o2: GPIO17
packages:
device_base: !include common.yaml
output:
- id: !extend light_output_1
- platform: ${light_platform}
id: light_output_1
pin: ${pin_o1}
channel: 0
- id: !extend light_output_2
- platform: ${light_platform}
id: light_output_2
pin: ${pin_o2}
channel: 1
phase_angle: 180°
<<: !include common.yaml

View File

@@ -3,4 +3,12 @@ substitutions:
pin_o1: GPIO12
pin_o2: GPIO13
output:
- platform: ${light_platform}
id: light_output_1
pin: ${pin_o1}
- platform: ${light_platform}
id: light_output_2
pin: ${pin_o2}
<<: !include common.yaml

View File

@@ -3,4 +3,12 @@ substitutions:
pin_o1: GPIO12
pin_o2: GPIO13
output:
- platform: ${light_platform}
id: light_output_1
pin: ${pin_o1}
- platform: ${light_platform}
id: light_output_2
pin: ${pin_o2}
<<: !include common.yaml

View File

@@ -31,9 +31,3 @@ fan:
on_preset_set:
then:
- logger.log: Preset mode was changed!
switch:
- platform: hbridge
id: switch_hbridge
on_pin: ${hbridge_on_pin}
off_pin: ${hbridge_off_pin}

View File

@@ -7,9 +7,11 @@ substitutions:
hbridge_on_pin: "2"
hbridge_off_pin: "3"
packages:
common: !include common.yaml
<<: !include common.yaml
switch:
- id: !extend switch_hbridge
- platform: hbridge
id: switch_hbridge
on_pin: ${hbridge_on_pin}
off_pin: ${hbridge_off_pin}
pulse_length: 60ms

View File

@@ -7,10 +7,12 @@ substitutions:
hbridge_on_pin: "4"
hbridge_off_pin: "5"
packages:
common: !include common.yaml
<<: !include common.yaml
switch:
- id: !extend switch_hbridge
- platform: hbridge
id: switch_hbridge
on_pin: ${hbridge_on_pin}
off_pin: ${hbridge_off_pin}
pulse_length: 60ms
wait_time: 10ms

View File

@@ -7,10 +7,12 @@ substitutions:
hbridge_on_pin: "14"
hbridge_off_pin: "15"
packages:
common: !include common.yaml
<<: !include common.yaml
switch:
- id: !extend switch_hbridge
- platform: hbridge
id: switch_hbridge
on_pin: ${hbridge_on_pin}
off_pin: ${hbridge_off_pin}
pulse_length: 60ms
wait_time: 10ms

View File

@@ -7,10 +7,12 @@ substitutions:
hbridge_on_pin: "2"
hbridge_off_pin: "3"
packages:
common: !include common.yaml
<<: !include common.yaml
switch:
- id: !extend switch_hbridge
- platform: hbridge
id: switch_hbridge
on_pin: ${hbridge_on_pin}
off_pin: ${hbridge_off_pin}
wait_time: 10ms
optimistic: true