From f8df648672cfb025f9cb13e2a67a0b52aac413ac Mon Sep 17 00:00:00 2001 From: Jan Grewe <jan@faked.org> Date: Sat, 26 Nov 2022 22:45:29 +0100 Subject: [PATCH] growbox: use fan and light components instead of number+lambda --- packages/gp8403.yaml | 50 ++++++++------------------------------------ 1 file changed, 9 insertions(+), 41 deletions(-) diff --git a/packages/gp8403.yaml b/packages/gp8403.yaml index effa837..bc45b68 100644 --- a/packages/gp8403.yaml +++ b/packages/gp8403.yaml @@ -18,46 +18,14 @@ output: - id: gp8403_ch0 - id: gp8403_ch1 -number: - - platform: template - id: dimmer_fan +fan: + - platform: speed + output: gp8403_ch0 + id: fan_speed name: "Fan: Speed" - min_value: 0 - max_value: 100 - step: 1 - unit_of_measurement: '%' - optimistic: true - restore_value: true - on_value: - then: - - lambda: !lambda 'id(gp8403_ch0).set_level(x / 100);' - - platform: template - id: dimmer_light - name: "Light: Level" - min_value: 0 - max_value: 100 - step: 1 - unit_of_measurement: '%' - optimistic: true - restore_value: true - on_value: - then: - - lambda: !lambda 'id(gp8403_ch1).set_level(x / 100);' -sensor: - - platform: template - internal: true - id: fan_speed - name: "Fan Speed" - unit_of_measurement: '%' - accuracy_decimals: 0 - lambda: !lambda 'return id(dimmer_fan).state;' - update_interval: 5s - - platform: template - internal: true - id: light_level - name: "Light Level" - unit_of_measurement: '%' - accuracy_decimals: 0 - lambda: !lambda 'return id(dimmer_light).state;' - update_interval: 5s +light: + - platform: monochromatic + name: "Light: Level" + output: gp8403_ch1 + default_transition_length: 0s -- GitLab