diff --git a/components/binary_sensor/day_night.yaml b/components/binary_sensor/day_night.yaml deleted file mode 100644 index 7457f85..0000000 --- a/components/binary_sensor/day_night.yaml +++ /dev/null @@ -1,3 +0,0 @@ -platform: homeassistant -id: day_night -entity_id: input_boolean.day_night diff --git a/components/binary_sensor/status.yaml b/components/binary_sensor/status.yaml deleted file mode 100644 index c339cbc..0000000 --- a/components/binary_sensor/status.yaml +++ /dev/null @@ -1,2 +0,0 @@ -platform: status -name: ${device_name} Status \ No newline at end of file diff --git a/components/sensor/uptime.yaml b/components/sensor/uptime.yaml deleted file mode 100644 index a86656e..0000000 --- a/components/sensor/uptime.yaml +++ /dev/null @@ -1,2 +0,0 @@ -platform: uptime -name: ${device_name} Uptime diff --git a/components/sensor/wifi.yaml b/components/sensor/wifi.yaml deleted file mode 100644 index 3ce38eb..0000000 --- a/components/sensor/wifi.yaml +++ /dev/null @@ -1,2 +0,0 @@ -platform: wifi_signal -name: ${device_name} WiFi Signal diff --git a/components/switch/restart.yaml b/components/switch/restart.yaml deleted file mode 100644 index 02f87f0..0000000 --- a/components/switch/restart.yaml +++ /dev/null @@ -1,3 +0,0 @@ -platform: restart -id: reboot -name: Restart ${device_name} \ No newline at end of file diff --git a/components/text_sensor/version.yaml b/components/text_sensor/version.yaml deleted file mode 100644 index cc80131..0000000 --- a/components/text_sensor/version.yaml +++ /dev/null @@ -1,2 +0,0 @@ -platform: version -name: ${device_name} Version \ No newline at end of file diff --git a/components/text_sensor/wifi.yaml b/components/text_sensor/wifi.yaml deleted file mode 100644 index cc41a53..0000000 --- a/components/text_sensor/wifi.yaml +++ /dev/null @@ -1,4 +0,0 @@ -platform: wifi_info -ip_address: - name: ${device_name} IP Address - icon: mdi:ip-network \ No newline at end of file diff --git a/components/uart/tuya.yaml b/components/uart/tuya.yaml deleted file mode 100644 index ad78c6f..0000000 --- a/components/uart/tuya.yaml +++ /dev/null @@ -1,3 +0,0 @@ -rx_pin: GPIO3 -tx_pin: GPIO1 -baud_rate: 9600 diff --git a/components/api/api.yaml b/packages/api/api.yaml similarity index 100% rename from components/api/api.yaml rename to packages/api/api.yaml diff --git a/packages/binary_sensor/day_night.yaml b/packages/binary_sensor/day_night.yaml new file mode 100644 index 0000000..717a6d6 --- /dev/null +++ b/packages/binary_sensor/day_night.yaml @@ -0,0 +1,4 @@ +binary_sensor: + - platform: homeassistant + id: day_night + entity_id: input_boolean.day_night diff --git a/packages/binary_sensor/status.yaml b/packages/binary_sensor/status.yaml new file mode 100644 index 0000000..6234ee6 --- /dev/null +++ b/packages/binary_sensor/status.yaml @@ -0,0 +1,3 @@ +binary_sensor: + - platform: status + name: ${device_name} Status \ No newline at end of file diff --git a/packages/device_base.yaml b/packages/device_base.yaml index 6b3b38a..b23277a 100644 --- a/packages/device_base.yaml +++ b/packages/device_base.yaml @@ -12,24 +12,15 @@ esphome: arduino_version: latest build_path: ../build/${device_id} -<<: !include ../components/wifi/wifi.yaml +packages: + wifi: !include wifi/wifi.yaml + api: !include api/api.yaml + ota: !include ota/ota.yaml + logger: !include logger/logger.yaml + status_sensor: !include binary_sensor/status.yaml + uptime_sensor: !include sensor/uptime.yaml + wifi_sensor: !include sensor/wifi.yaml + restart_switch: !include switch/restart.yaml + version_sensor: !include text_sensor/version.yaml + wifi_info_sensor: !include text_sensor/wifi_info.yaml -<<: !include ../components/api/api.yaml - -<<: !include ../components/ota/ota.yaml - -<<: !include ../components/logger/logger.yaml - -binary_sensor: - - !include ../components/binary_sensor/status.yaml - -sensor: - - !include ../components/sensor/uptime.yaml - - !include ../components/sensor/wifi.yaml - -switch: - - !include ../components/switch/restart.yaml - -text_sensor: - - !include ../components/text_sensor/version.yaml - - !include ../components/text_sensor/wifi.yaml diff --git a/packages/feit_dimmer.yaml b/packages/feit_dimmer.yaml index 00365a0..e76366a 100644 --- a/packages/feit_dimmer.yaml +++ b/packages/feit_dimmer.yaml @@ -11,9 +11,9 @@ esphome: - script.execute: startup packages: - device_base: !include device_base.yaml - -<<: !include ../components/logger/logger_no_serial.yaml + base: !include device_base.yaml + logger: !include logger/logger_no_serial.yaml + uart: !include uart/tuya.yaml light: - platform: custom @@ -41,6 +41,3 @@ light: default_transition_length: 0s tuya: - -uart: - - !include ../components/uart/tuya.yaml diff --git a/packages/feit_dimmer_as_fan.yaml b/packages/feit_dimmer_as_fan.yaml index 37900b2..babdae8 100644 --- a/packages/feit_dimmer_as_fan.yaml +++ b/packages/feit_dimmer_as_fan.yaml @@ -7,9 +7,9 @@ esphome: - ../custom/tuya_dimmer_as_binary_fan_output.h packages: - device_base: !include device_base.yaml - -<<: !include ../components/logger/logger_no_serial.yaml + base: !include device_base.yaml + logger: !include logger/logger_no_serial.yaml + uart: !include uart/tuya.yaml fan: - platform: binary @@ -33,6 +33,3 @@ output: id: tuya_fan_output tuya: - -uart: - - !include ../components/uart/tuya.yaml diff --git a/components/logger/logger.yaml b/packages/logger/logger.yaml similarity index 100% rename from components/logger/logger.yaml rename to packages/logger/logger.yaml diff --git a/components/logger/logger_no_serial.yaml b/packages/logger/logger_no_serial.yaml similarity index 100% rename from components/logger/logger_no_serial.yaml rename to packages/logger/logger_no_serial.yaml diff --git a/components/ota/ota.yaml b/packages/ota/ota.yaml similarity index 100% rename from components/ota/ota.yaml rename to packages/ota/ota.yaml diff --git a/packages/scripture_of_the_day.yaml b/packages/scripture_of_the_day.yaml index 3eabb81..3ee3d45 100644 --- a/packages/scripture_of_the_day.yaml +++ b/packages/scripture_of_the_day.yaml @@ -14,9 +14,9 @@ esphome: includes: - ../custom/scripture_of_the_day.h -<<: !include ../components/wifi/wifi_dhcp.yaml - -<<: !include ../components/logger/logger.yaml +packages: + wifi: !include wifi/wifi_dhcp.yaml + logger: !include logger/logger.yaml custom_component: - lambda: |- diff --git a/packages/sensor/uptime.yaml b/packages/sensor/uptime.yaml new file mode 100644 index 0000000..e2c448c --- /dev/null +++ b/packages/sensor/uptime.yaml @@ -0,0 +1,3 @@ +sensor: + - platform: uptime + name: ${device_name} Uptime diff --git a/packages/sensor/wifi.yaml b/packages/sensor/wifi.yaml new file mode 100644 index 0000000..2f6c4b5 --- /dev/null +++ b/packages/sensor/wifi.yaml @@ -0,0 +1,3 @@ +sensor: + - platform: wifi_signal + name: ${device_name} WiFi Signal diff --git a/packages/switch/restart.yaml b/packages/switch/restart.yaml new file mode 100644 index 0000000..6991ba8 --- /dev/null +++ b/packages/switch/restart.yaml @@ -0,0 +1,4 @@ +switch: + - platform: restart + id: reboot + name: Restart ${device_name} \ No newline at end of file diff --git a/packages/text_sensor/version.yaml b/packages/text_sensor/version.yaml new file mode 100644 index 0000000..31f6630 --- /dev/null +++ b/packages/text_sensor/version.yaml @@ -0,0 +1,3 @@ +text_sensor: + - platform: version + name: ${device_name} Version \ No newline at end of file diff --git a/packages/text_sensor/wifi_info.yaml b/packages/text_sensor/wifi_info.yaml new file mode 100644 index 0000000..d8a492e --- /dev/null +++ b/packages/text_sensor/wifi_info.yaml @@ -0,0 +1,5 @@ +text_sensor: + - platform: wifi_info + ip_address: + name: ${device_name} IP Address + icon: mdi:ip-network \ No newline at end of file diff --git a/packages/uart/tuya.yaml b/packages/uart/tuya.yaml new file mode 100644 index 0000000..e30e46a --- /dev/null +++ b/packages/uart/tuya.yaml @@ -0,0 +1,4 @@ +uart: + rx_pin: GPIO3 + tx_pin: GPIO1 + baud_rate: 9600 diff --git a/components/wifi/wifi.yaml b/packages/wifi/wifi.yaml similarity index 100% rename from components/wifi/wifi.yaml rename to packages/wifi/wifi.yaml diff --git a/components/wifi/wifi_dhcp.yaml b/packages/wifi/wifi_dhcp.yaml similarity index 100% rename from components/wifi/wifi_dhcp.yaml rename to packages/wifi/wifi_dhcp.yaml