mirror of
https://github.com/nuttytree/ESPHome-Devices.git
synced 2024-08-30 18:12:19 +00:00
52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
substitutions:
|
|
platform: ESP8266
|
|
board: esp01_1m
|
|
log_level: verbose
|
|
|
|
esphome:
|
|
includes:
|
|
- ../custom/tuya_light_plus.h
|
|
on_boot:
|
|
priority: -100
|
|
then:
|
|
- script.execute: startup
|
|
|
|
external_components:
|
|
# - source: github://nuttytree/esphome@more-tuya-reliability-improvements
|
|
- source:
|
|
type: local
|
|
path: ../components
|
|
components: [ tuya ]
|
|
|
|
packages:
|
|
base: !include device_base.yaml
|
|
logger: !include logger/logger_no_serial.yaml
|
|
uart: !include uart/tuya.yaml
|
|
|
|
tuya:
|
|
|
|
light:
|
|
- 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_while_off_stays_on(${double_tap_while_off_stays_on});
|
|
App.register_component(TuyaLight);
|
|
return {TuyaLight};
|
|
lights:
|
|
- id: tuya_light
|
|
name: ${device_name}
|
|
gamma_correct: 1.0
|
|
default_transition_length: 0s
|