From f58434084a690dbc8bd2ff7457500552834dbc89 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Thu, 9 Feb 2023 08:28:17 +0100 Subject: [PATCH] Streamline example configurations (#15) --- .github/workflows/ci.yaml | 16 ++++++++-------- components/votronic/__init__.py | 2 +- esp8266-charger-example-debug.yaml | 10 ++++++++++ esp8266-charger-example-faker.yaml | 18 ++++++++++++++++++ esp8266-charger-example.yaml | 6 +----- esp8266-charging-converter-example-debug.yaml | 10 ++++++++++ esp8266-charging-converter-example-faker.yaml | 18 ++++++++++++++++++ esp8266-charging-converter-example.yaml | 6 +----- esp8266-solar-charger-example-debug.yaml | 10 ++++++++++ esp8266-solar-charger-example-faker.yaml | 18 ++++++++++++++++++ esp8266-solar-charger-example.yaml | 14 +------------- test-esp8266.sh | 2 +- 12 files changed, 97 insertions(+), 33 deletions(-) create mode 100644 esp8266-charger-example-debug.yaml create mode 100644 esp8266-charger-example-faker.yaml create mode 100644 esp8266-charging-converter-example-debug.yaml create mode 100644 esp8266-charging-converter-example-faker.yaml create mode 100644 esp8266-solar-charger-example-debug.yaml create mode 100644 esp8266-solar-charger-example-faker.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 66629ab..04c9f53 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -164,11 +164,11 @@ jobs: shell: bash run: 'echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > tests/secrets.yaml' - run: | - esphome -s external_components_source components config esp32-ble-example.yaml + esphome -s external_components_source components config esp32-ble-example-faker.yaml - run: | - esphome -s external_components_source components config esp8266-solar-charger-example.yaml - esphome -s external_components_source components config esp8266-charger-example.yaml - esphome -s external_components_source components config esp8266-charging-converter-example.yaml + esphome -s external_components_source components config esp8266-solar-charger-example-faker.yaml + esphome -s external_components_source components config esp8266-charger-example-faker.yaml + esphome -s external_components_source components config esp8266-charging-converter-example-faker.yaml - run: | esphome -s external_components_source ../components config tests/esp8266-fake-charger.yaml esphome -s external_components_source ../components config tests/esp8266-fake-charging-converter.yaml @@ -210,8 +210,8 @@ jobs: shell: bash run: 'echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > secrets.yaml' - run: | - esphome -s external_components_source components compile esp32-ble-example.yaml + esphome -s external_components_source components compile esp32-ble-example-faker.yaml - run: | - esphome -s external_components_source components compile esp8266-solar-charger-example.yaml - esphome -s external_components_source components compile esp8266-charger-example.yaml - esphome -s external_components_source components compile esp8266-charging-converter-example.yaml + esphome -s external_components_source components compile esp8266-solar-charger-example-faker.yaml + esphome -s external_components_source components compile esp8266-charger-example-faker.yaml + esphome -s external_components_source components compile esp8266-charging-converter-example-faker.yaml diff --git a/components/votronic/__init__.py b/components/votronic/__init__.py index 04bf46a..0c7c6b3 100644 --- a/components/votronic/__init__.py +++ b/components/votronic/__init__.py @@ -27,7 +27,7 @@ CONFIG_SCHEMA = ( ): cv.positive_time_period_milliseconds, } ) - .extend(cv.polling_component_schema("2s")) + .extend(cv.polling_component_schema("never")) .extend(uart.UART_DEVICE_SCHEMA) ) diff --git a/esp8266-charger-example-debug.yaml b/esp8266-charger-example-debug.yaml new file mode 100644 index 0000000..481a0b2 --- /dev/null +++ b/esp8266-charger-example-debug.yaml @@ -0,0 +1,10 @@ +<<: !include esp8266-charger-example.yaml + +logger: + level: VERY_VERBOSE + logs: + component: DEBUG + scheduler: INFO + binary_sensor: DEBUG + sensor: DEBUG + text_sensor: DEBUG diff --git a/esp8266-charger-example-faker.yaml b/esp8266-charger-example-faker.yaml new file mode 100644 index 0000000..5209931 --- /dev/null +++ b/esp8266-charger-example-faker.yaml @@ -0,0 +1,18 @@ +<<: !include esp8266-charger-example-debug.yaml + +uart: + - id: uart0 + baud_rate: 1000 + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + debug: + direction: BOTH + dummy_receiver: false + +votronic: + - id: votronic0 + uart_id: uart0 + rx_timeout: ${rx_timeout} + throttle: 0ms + update_interval: 1s + enable_fake_traffic: true diff --git a/esp8266-charger-example.yaml b/esp8266-charger-example.yaml index 8d2552f..6cdbff9 100644 --- a/esp8266-charger-example.yaml +++ b/esp8266-charger-example.yaml @@ -41,16 +41,12 @@ uart: baud_rate: 1000 tx_pin: ${tx_pin} rx_pin: ${rx_pin} - debug: - direction: BOTH - dummy_receiver: false votronic: - id: votronic0 uart_id: uart0 - update_interval: 2s rx_timeout: ${rx_timeout} - enable_fake_traffic: false + throttle: 2s binary_sensor: - platform: votronic diff --git a/esp8266-charging-converter-example-debug.yaml b/esp8266-charging-converter-example-debug.yaml new file mode 100644 index 0000000..ff25fcc --- /dev/null +++ b/esp8266-charging-converter-example-debug.yaml @@ -0,0 +1,10 @@ +<<: !include esp8266-charging-converter-example.yaml + +logger: + level: VERY_VERBOSE + logs: + component: DEBUG + scheduler: INFO + binary_sensor: DEBUG + sensor: DEBUG + text_sensor: DEBUG diff --git a/esp8266-charging-converter-example-faker.yaml b/esp8266-charging-converter-example-faker.yaml new file mode 100644 index 0000000..a589928 --- /dev/null +++ b/esp8266-charging-converter-example-faker.yaml @@ -0,0 +1,18 @@ +<<: !include esp8266-charging-converter-example-debug.yaml + +uart: + - id: uart0 + baud_rate: 1000 + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + debug: + direction: BOTH + dummy_receiver: false + +votronic: + - id: votronic0 + uart_id: uart0 + rx_timeout: ${rx_timeout} + throttle: 0ms + update_interval: 1s + enable_fake_traffic: true diff --git a/esp8266-charging-converter-example.yaml b/esp8266-charging-converter-example.yaml index 8d2552f..6cdbff9 100644 --- a/esp8266-charging-converter-example.yaml +++ b/esp8266-charging-converter-example.yaml @@ -41,16 +41,12 @@ uart: baud_rate: 1000 tx_pin: ${tx_pin} rx_pin: ${rx_pin} - debug: - direction: BOTH - dummy_receiver: false votronic: - id: votronic0 uart_id: uart0 - update_interval: 2s rx_timeout: ${rx_timeout} - enable_fake_traffic: false + throttle: 2s binary_sensor: - platform: votronic diff --git a/esp8266-solar-charger-example-debug.yaml b/esp8266-solar-charger-example-debug.yaml new file mode 100644 index 0000000..4bea8eb --- /dev/null +++ b/esp8266-solar-charger-example-debug.yaml @@ -0,0 +1,10 @@ +<<: !include esp8266-solar-charger-example.yaml + +logger: + level: VERY_VERBOSE + logs: + component: DEBUG + scheduler: INFO + binary_sensor: DEBUG + sensor: DEBUG + text_sensor: DEBUG diff --git a/esp8266-solar-charger-example-faker.yaml b/esp8266-solar-charger-example-faker.yaml new file mode 100644 index 0000000..7e1fea4 --- /dev/null +++ b/esp8266-solar-charger-example-faker.yaml @@ -0,0 +1,18 @@ +<<: !include esp8266-solar-charger-example-debug.yaml + +uart: + - id: uart0 + baud_rate: 1000 + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + debug: + direction: BOTH + dummy_receiver: false + +votronic: + - id: votronic0 + uart_id: uart0 + rx_timeout: ${rx_timeout} + throttle: 0ms + update_interval: 1s + enable_fake_traffic: true diff --git a/esp8266-solar-charger-example.yaml b/esp8266-solar-charger-example.yaml index 2f0dac6..cfd6e4d 100644 --- a/esp8266-solar-charger-example.yaml +++ b/esp8266-solar-charger-example.yaml @@ -25,15 +25,7 @@ wifi: password: !secret wifi_password ota: - logger: - level: VERY_VERBOSE - logs: - component: DEBUG - scheduler: INFO - binary_sensor: DEBUG - sensor: DEBUG - text_sensor: DEBUG # If you use Home Assistant please remove this `mqtt` section and uncomment the native `api` component! # api: @@ -49,16 +41,12 @@ uart: baud_rate: 1000 tx_pin: ${tx_pin} rx_pin: ${rx_pin} - debug: - direction: BOTH - dummy_receiver: false votronic: - id: votronic0 uart_id: uart0 - update_interval: 2s rx_timeout: ${rx_timeout} - enable_fake_traffic: false + throttle: 2s binary_sensor: - platform: votronic diff --git a/test-esp8266.sh b/test-esp8266.sh index 332ef1a..1475dc5 100755 --- a/test-esp8266.sh +++ b/test-esp8266.sh @@ -1,3 +1,3 @@ #!/bin/bash -esphome -s external_components_source components ${1:-run} ${2:-esp8266-example-faker.yaml} +esphome -s external_components_source components ${1:-run} ${2:-esp8266-solar-charger-example-faker.yaml}