-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make -m upk2esphome.test exit(1) when yaml content is not as expected * add output verification workflow
- Loading branch information
Showing
25 changed files
with
1,073 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Check ESPHome YAML output | ||
on: | ||
push: | ||
branches: ["**"] | ||
pull_request: | ||
jobs: | ||
check-output: | ||
name: Verify YAML output | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- run: python3 -m upk2esphome.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
output: | ||
- platform: libretiny_pwm | ||
id: output_brightness | ||
pin: P8 | ||
- platform: libretiny_pwm | ||
id: output_temperature | ||
pin: P7 | ||
|
||
light: | ||
- platform: color_temperature | ||
id: light_color_temperature | ||
name: Light | ||
cold_white_color_temperature: 6500 K | ||
warm_white_color_temperature: 2700 K | ||
brightness: output_brightness | ||
color_temperature: output_temperature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
output: | ||
- platform: libretiny_pwm | ||
id: output_cold | ||
pin: P7 | ||
- platform: libretiny_pwm | ||
id: output_warm | ||
pin: P6 | ||
|
||
light: | ||
- platform: cwww | ||
id: light_cwww | ||
name: Light | ||
cold_white_color_temperature: 6500 K | ||
warm_white_color_temperature: 2700 K | ||
cold_white: output_cold | ||
warm_white: output_warm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
output: | ||
- platform: libretiny_pwm | ||
id: output_red | ||
pin: P24 | ||
- platform: libretiny_pwm | ||
id: output_green | ||
pin: P9 | ||
- platform: libretiny_pwm | ||
id: output_blue | ||
pin: P26 | ||
- platform: libretiny_pwm | ||
id: output_brightness | ||
pin: P7 | ||
- platform: libretiny_pwm | ||
id: output_temperature | ||
pin: P8 | ||
|
||
light: | ||
- platform: rgbct | ||
id: light_rgbct | ||
name: Light | ||
color_interlock: true | ||
cold_white_color_temperature: 6500 K | ||
warm_white_color_temperature: 2700 K | ||
red: output_red | ||
green: output_green | ||
blue: output_blue | ||
white_brightness: output_brightness | ||
color_temperature: output_temperature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
output: | ||
- platform: libretiny_pwm | ||
id: output_red | ||
pin: P6 | ||
- platform: libretiny_pwm | ||
id: output_green | ||
pin: P26 | ||
- platform: libretiny_pwm | ||
id: output_blue | ||
pin: P24 | ||
- platform: libretiny_pwm | ||
id: output_cold | ||
pin: P7 | ||
- platform: libretiny_pwm | ||
id: output_warm | ||
pin: P8 | ||
|
||
light: | ||
- platform: rgbww | ||
id: light_rgbww | ||
name: Light | ||
color_interlock: true | ||
cold_white_color_temperature: 6500 K | ||
warm_white_color_temperature: 2700 K | ||
red: output_red | ||
green: output_green | ||
blue: output_blue | ||
cold_white: output_cold | ||
warm_white: output_warm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
sm2135: | ||
clock_pin: P8 | ||
data_pin: P7 | ||
rgb_current: 30mA | ||
cw_current: 45mA | ||
|
||
output: | ||
- platform: sm2135 | ||
id: output_red | ||
channel: 2 | ||
- platform: sm2135 | ||
id: output_green | ||
channel: 1 | ||
- platform: sm2135 | ||
id: output_blue | ||
channel: 0 | ||
- platform: sm2135 | ||
id: output_cold | ||
channel: 3 | ||
|
||
light: | ||
- platform: rgbw | ||
id: light_rgbw | ||
name: Light | ||
red: output_red | ||
green: output_green | ||
blue: output_blue | ||
white: output_cold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
sm2135: | ||
clock_pin: P7 | ||
data_pin: P9 | ||
rgb_current: 40mA | ||
cw_current: 25mA | ||
|
||
output: | ||
- platform: sm2135 | ||
id: output_red | ||
channel: 2 | ||
- platform: sm2135 | ||
id: output_green | ||
channel: 1 | ||
- platform: sm2135 | ||
id: output_blue | ||
channel: 0 | ||
- platform: sm2135 | ||
id: output_cold | ||
channel: 4 | ||
- platform: sm2135 | ||
id: output_warm | ||
channel: 3 | ||
|
||
light: | ||
- platform: rgbww | ||
id: light_rgbww | ||
name: Light | ||
color_interlock: true | ||
cold_white_color_temperature: 6500 K | ||
warm_white_color_temperature: 2700 K | ||
red: output_red | ||
green: output_green | ||
blue: output_blue | ||
cold_white: output_cold | ||
warm_white: output_warm |
35 changes: 35 additions & 0 deletions
35
upk2esphome/tests/expected_output/bulb_rgbcw_2135_ampere.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
sm2135: | ||
clock_pin: P8 | ||
data_pin: P26 | ||
rgb_current: 20mA | ||
cw_current: 50mA | ||
|
||
output: | ||
- platform: sm2135 | ||
id: output_red | ||
channel: 2 | ||
- platform: sm2135 | ||
id: output_green | ||
channel: 1 | ||
- platform: sm2135 | ||
id: output_blue | ||
channel: 0 | ||
- platform: sm2135 | ||
id: output_cold | ||
channel: 4 | ||
- platform: sm2135 | ||
id: output_warm | ||
channel: 3 | ||
|
||
light: | ||
- platform: rgbww | ||
id: light_rgbww | ||
name: Light | ||
color_interlock: true | ||
cold_white_color_temperature: 6500 K | ||
warm_white_color_temperature: 2700 K | ||
red: output_red | ||
green: output_green | ||
blue: output_blue | ||
cold_white: output_cold | ||
warm_white: output_warm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
sm2235: | ||
clock_pin: P26 | ||
data_pin: P24 | ||
max_power_color_channels: 1 | ||
max_power_white_channels: 2 | ||
|
||
output: | ||
- platform: sm2235 | ||
id: output_red | ||
channel: 1 | ||
- platform: sm2235 | ||
id: output_green | ||
channel: 0 | ||
- platform: sm2235 | ||
id: output_blue | ||
channel: 2 | ||
- platform: sm2235 | ||
id: output_cold | ||
channel: 4 | ||
- platform: sm2235 | ||
id: output_warm | ||
channel: 3 | ||
|
||
light: | ||
- platform: rgbww | ||
id: light_rgbww | ||
name: Light | ||
color_interlock: true | ||
cold_white_color_temperature: 6500 K | ||
warm_white_color_temperature: 2700 K | ||
red: output_red | ||
green: output_green | ||
blue: output_blue | ||
cold_white: output_cold | ||
warm_white: output_warm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
bp5758d: | ||
clock_pin: P24 | ||
data_pin: P26 | ||
|
||
output: | ||
- platform: bp5758d | ||
id: output_red | ||
channel: 2 | ||
current: 14 | ||
- platform: bp5758d | ||
id: output_green | ||
channel: 1 | ||
current: 14 | ||
- platform: bp5758d | ||
id: output_blue | ||
channel: 3 | ||
current: 14 | ||
- platform: bp5758d | ||
id: output_cold | ||
channel: 5 | ||
current: 26 | ||
- platform: bp5758d | ||
id: output_warm | ||
channel: 4 | ||
current: 26 | ||
|
||
light: | ||
- platform: rgbww | ||
id: light_rgbww | ||
name: Light | ||
color_interlock: true | ||
cold_white_color_temperature: 6500 K | ||
warm_white_color_temperature: 2700 K | ||
red: output_red | ||
green: output_green | ||
blue: output_blue | ||
cold_white: output_cold | ||
warm_white: output_warm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
44 changes: 44 additions & 0 deletions
44
upk2esphome/tests/expected_output/plug_monitor_bl0937.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
binary_sensor: | ||
- platform: gpio | ||
id: binary_switch_1 | ||
pin: | ||
number: P10 | ||
inverted: true | ||
mode: INPUT_PULLUP | ||
on_press: | ||
then: | ||
- switch.toggle: switch_1 | ||
|
||
switch: | ||
- platform: gpio | ||
id: switch_1 | ||
name: Relay 1 | ||
pin: P26 | ||
|
||
status_led: | ||
pin: | ||
number: P6 | ||
inverted: true | ||
|
||
sensor: | ||
- platform: hlw8012 | ||
model: BL0937 | ||
cf_pin: | ||
number: P7 | ||
inverted: true | ||
cf1_pin: | ||
number: P8 | ||
inverted: true | ||
sel_pin: | ||
number: P24 | ||
inverted: true | ||
current: | ||
name: BL0937 Current | ||
voltage: | ||
name: BL0937 Voltage | ||
power: | ||
name: BL0937 Power | ||
energy: | ||
name: BL0937 Energy | ||
voltage_divider: 1600 | ||
current_resistor: 0.001 ohm |
Oops, something went wrong.