ESPHome-Devices/packages/feit_dimmer.yaml
ChNussbaum 56abafbb31 Use packages
More folder restructuring
2020-10-07 07:56:19 -05:00

51 lines
1.4 KiB
YAML

substitutions:
platform: ESP8266
board: esp01_1m
esphome:
includes:
- ../custom/tuya_light_plus.h
on_boot:
priority: -100
then:
- script.execute: startup
packages:
device_base: !include device_base.yaml
<<: !include ../components/logger/logger_no_serial.yaml
light:
# We need this dummy light to get the base tuya_light code pulled in to the build folder
- platform: "tuya"
id: dummy_light
switch_datapoint: 255
- platform: custom
lambda: |-
TuyaLight = new TuyaLightPlus();
TuyaLight->set_switch_id(1);
TuyaLight->set_dimmer_id(2);
TuyaLight->set_min_value(0);
TuyaLight->set_max_value(1000);
TuyaLight->set_tuya_parent(tuya_tuya);
TuyaLight->set_day_night_sensor("sensor.day_night");
TuyaLight->set_day_default_brightness(${day_brightness});
TuyaLight->set_night_default_brightness(${night_brightness});
TuyaLight->set_day_auto_off_minutes(${day_auto_off_minutes});
TuyaLight->set_night_auto_off_minutes(${night_auto_off_minutes});
TuyaLight->set_api_server(api_apiserver);
TuyaLight->set_linked_lights("${linked_lights}");
TuyaLight->set_double_tap_on_stays_on(${double_tap_on_stays_on});
App.register_component(TuyaLight);
return {TuyaLight};
lights:
- id: tuya_light
name: ${device_name}
gamma_correct: 1.0
default_transition_length: 0s
tuya:
uart:
- !include ../components/uart/tuya.yaml