From 4bd75cd526c3c387376a1cf9dcba2371dcaeeb60 Mon Sep 17 00:00:00 2001 From: wildwiz Date: Sun, 22 Apr 2018 14:22:06 +0200 Subject: [PATCH] support for zhilde ZLD-EU44-W power strip --- code/espurna/config/hardware.h | 31 +++++++++++++++++++++++++++++++ code/platformio.ini | 27 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 0f202cc9..9cdc9cd1 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -1797,6 +1797,37 @@ #define LED1_PIN 12 // D6 #define LED1_PIN_INVERSE 1 +// ----------------------------------------------------------------------------- +// Zhilde ZLD-EU44-W +// http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html +// ----------------------------------------------------------------------------- + +#elif defined(ZHILDE_EU44_W) + + // Info + #define MANUFACTURER "ZHILDE" + #define DEVICE "ZLD_EU44_W" + + // Buttons + #define BUTTON1_PIN 3 + #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + + // Relays + #define RELAY1_PIN 5 + #define RELAY2_PIN 4 + #define RELAY3_PIN 12 + #define RELAY4_PIN 13 + #define RELAY5_PIN 14 + #define RELAY1_TYPE RELAY_TYPE_NORMAL + #define RELAY2_TYPE RELAY_TYPE_NORMAL + #define RELAY3_TYPE RELAY_TYPE_NORMAL + #define RELAY4_TYPE RELAY_TYPE_NORMAL + #define RELAY5_TYPE RELAY_TYPE_NORMAL + + // LEDs + #define LED1_PIN 1 + #define LED1_PIN_INVERSE 1 + // ----------------------------------------------------------------------------- // TEST boards (do not use!!) // ----------------------------------------------------------------------------- diff --git a/code/platformio.ini b/code/platformio.ini index 0d1dd602..9574728c 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -1747,6 +1747,33 @@ upload_port = "${env.ESPURNA_IP}" upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 extra_scripts = ${common.extra_scripts} +# ------------------------------------------------------------------------------ + +[env:zhilde-eu44-w] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m} -DZHILDE_EU44_W +monitor_baud = 115200 +extra_scripts = ${common.extra_scripts} + +[env:zhilde-eu44-w-ota] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m} -DZHILDE_EU44_W +upload_speed = 115200 +upload_port = "192.168.4.1" +upload_flags = --auth=fibonacci --port 8266 +monitor_baud = 115200 +extra_scripts = ${common.extra_scripts} + # ------------------------------------------------------------------------------ # GENERIC OTA ENVIRONMENTS # ------------------------------------------------------------------------------