From 774a73d1d42c0ff9b0d6305e82100ea1ee9726aa Mon Sep 17 00:00:00 2001 From: Matt Black Date: Sat, 27 Jun 2020 14:54:58 +1000 Subject: [PATCH] Including support for Arlec PC190HA/PB89HA (#2286) --- code/espurna/config/arduino.h | 2 ++ code/espurna/config/hardware.h | 51 ++++++++++++++++++++++++++++++++++ code/platformio.ini | 8 ++++++ 3 files changed, 61 insertions(+) diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index 8cbb43cc..b50ffcee 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -22,6 +22,8 @@ //#define ARILUX_AL_LC06 //#define ARILUX_AL_LC11 //#define ARILUX_E27 +//#define ARLEC_PB89HA +//#define ARLEC_PC190HA //#define ARNIEX_SWIFITCH //#define AUTHOMETION_LYT8266 //#define AVATTO_NAS_WR01W diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 40e192b9..6367660b 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -4763,6 +4763,57 @@ #define LED1_PIN 1 #define LED1_PIN_INVERSE 1 +// ----------------------------------------------------------------------------- +// Arlec Smart PC190HA Plug +// https://templates.blakadder.com/arlec_PC190HA.html +// ----------------------------------------------------------------------------- + +#elif defined(ARLEC_PC190HA) + + // Info + #define MANUFACTURER "ARLEC" + #define DEVICE "PC190HA" + + // Buttons + #define BUTTON1_PIN 14 + #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + #define BUTTON1_RELAY 1 + + // Relays + #define RELAY1_PIN 12 + #define RELAY1_TYPE RELAY_TYPE_NORMAL + + // LEDs + #define LED1_PIN 4 // blue LED + #define LED1_PIN_INVERSE 1 + #define LED2_PIN 13 // red LED + #define LED2_PIN_INVERSE 1 + +// ----------------------------------------------------------------------------- +// Arlec Smart PB89HA Power Strip +// https://templates.blakadder.com/arlec_PB89HA.html +// ----------------------------------------------------------------------------- + +#elif defined(ARLEC_PB89HA) + + // Info + #define MANUFACTURER "ARLEC" + #define DEVICE "PB89HA" + + // Buttons + #define BUTTON1_PIN 3 + #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + + // Relays + #define RELAY1_PIN 5 + #define RELAY2_PIN 4 + #define RELAY3_PIN 13 + #define RELAY4_PIN 12 + + // LEDs + #define LED1_PIN 1 + #define LED1_PIN_INVERSE 1 + // ----------------------------------------------------------------------------- #else diff --git a/code/platformio.ini b/code/platformio.ini index 059f1227..ae0adf7e 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -1023,3 +1023,11 @@ src_build_flags = -DNEDIS_WIFIP310FWT [env:nedis-wifip310fwt-sensor] extends = env:esp8266-1m-base src_build_flags = -DNEDIS_WIFIP310FWT -DANALOG_SUPPORT=1 + +[env:arlec-pc190ha] +extends = env:esp8266-1m-base +src_build_flags = -DARLEC_PC190HA + +[env:arlec-pb89ha] +extends = env:esp8266-1m-base +src_build_flags = -DARLEC_PB89HA