diff --git a/code/build.sh b/code/build.sh index caf2670a..5b1fd86d 100755 --- a/code/build.sh +++ b/code/build.sh @@ -26,7 +26,8 @@ if [ $# -eq 0 ]; then # Hook to build travis test envs if [[ "${TRAVIS_BRANCH}" != "" ]]; then - if [[ ${TRAVIS_BRANCH} != "master" ]]; then + re='^[0-9]+\.[0-9]+\.[0-9]+$' + if ! [[ ${TRAVIS_BRANCH} =~ $re ]]; then environments=$travis fi fi diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index d573c59b..ea6e9c83 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -77,6 +77,7 @@ //#define GENERIC_ESP01S_DHT11_V10 //#define GENERIC_ESP01S_DS18B20_V10 //#define HELTEC_TOUCHRELAY +//#define ZHILDE_EU44_W //-------------------------------------------------------------------------------- // Features (values below are non-default values) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 08d6cb83..690a7610 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -1916,6 +1916,42 @@ #define RELAY1_PIN 12 #define RELAY1_TYPE RELAY_TYPE_NORMAL + +// ----------------------------------------------------------------------------- +// 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 "EU44_W" + + // Based on the reporter, this product uses GPIO1 and 3 for the button + // and onboard LED, so hardware serial should be disabled... + #define DEBUG_SERIAL_SUPPORT 0 + + // 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/espurna/migrate.ino b/code/espurna/migrate.ino index 104ca56d..8bf615a0 100644 --- a/code/espurna/migrate.ino +++ b/code/espurna/migrate.ino @@ -888,6 +888,23 @@ void migrate() { setSetting("board", 69); + #elif defined(ZHILDE_EU44_W) + + setSetting("board", 70); + setSetting("btnGPIO", 0, 3); + setSetting("ledGPIO", 0, 1); + setSetting("ledLogic", 0, 1); + setSetting("relayGPIO", 0, 5); + setSetting("relayGPIO", 1, 4); + setSetting("relayGPIO", 2, 12); + setSetting("relayGPIO", 3, 13); + setSetting("relayGPIO", 4, 14); + setSetting("relayType", 0, RELAY_TYPE_NORMAL); + setSetting("relayType", 1, RELAY_TYPE_NORMAL); + setSetting("relayType", 2, RELAY_TYPE_NORMAL); + setSetting("relayType", 3, RELAY_TYPE_NORMAL); + setSetting("relayType", 4, RELAY_TYPE_NORMAL); + #else // Allow users to define new settings without migration config diff --git a/code/platformio.ini b/code/platformio.ini index d0088d3f..8b3914c8 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -1874,6 +1874,35 @@ 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 +# ------------------------------------------------------------------------------ + [env:generic-esp01s-relay-40] platform = ${common.platform} framework = arduino