Skip to content

Commit

Permalink
Added support Authometion LYT8266 (testing)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoseperez committed Oct 19, 2017
1 parent 294c12f commit 8bad421
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/espurna/config/arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
//#define INTERMITTECH_QUINLED
//#define ARILUX_AL_LC06
//#define XENON_SM_PW702U
//#define AUTHOMETION_LYT8266

//--------------------------------------------------------------------------------
// Features (values below are non-default values)
Expand Down
27 changes: 27 additions & 0 deletions code/espurna/config/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,33 @@
#define LED1_PIN 4
#define LED1_PIN_INVERSE 1

// -----------------------------------------------------------------------------
// AUTHOMETION LYT8266
// https://authometion.com/shop/en/home/13-lyt8266.html
// -----------------------------------------------------------------------------

#elif defined(AUTHOMETION_LYT8266)

// Info
#define MANUFACTURER "AUTHOMETION"
#define DEVICE "LYT8266"
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define DUMMY_RELAY_COUNT 1

// Channels
#define LIGHT_CH1_PIN 13 // RED
#define LIGHT_CH2_PIN 12 // GREEN
#define LIGHT_CH3_PIN 14 // BLUE
#define LIGHT_CH4_PIN 2 // WHITE

#define LIGHT_CH1_INVERSE 0
#define LIGHT_CH2_INVERSE 0
#define LIGHT_CH3_INVERSE 0
#define LIGHT_CH4_INVERSE 0

#define LIGHT_ENABLE_PIN 15

// -----------------------------------------------------------------------------
// Unknown hardware
// -----------------------------------------------------------------------------
Expand Down
16 changes: 16 additions & 0 deletions code/espurna/hardware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,22 @@ void hwUpwardsCompatibility() {
setSetting("relayGPIO", 1, 12);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);

#elif defined(AUTHOMETION_LYT8266)

setSetting("board", 45);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
setSetting("chGPIO", 1, 13);
setSetting("chGPIO", 2, 12);
setSetting("chGPIO", 3, 14);
setSetting("chGPIO", 4, 2);
setSetting("chLogic", 1, 0);
setSetting("chLogic", 2, 0);
setSetting("chLogic", 3, 0);
setSetting("chLogic", 4, 0);
setSetting("relays", 1);
setSetting("enGPIO", 15);

#else

#error "UNSUPPORTED HARDWARE!"
Expand Down
8 changes: 8 additions & 0 deletions code/espurna/light.ino
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ void _lightProviderUpdate() {

_shadow();

#ifdef LIGHT_ENABLE_PIN
digitalWrite(LIGHT_ENABLE_PIN, _lightState);
#endif

#if LIGHT_PROVIDER == LIGHT_PROVIDER_MY9192

if (_lightState) {
Expand Down Expand Up @@ -542,6 +546,10 @@ void _lightAPISetup() {

void lightSetup() {

#ifdef LIGHT_ENABLE_PIN
pinMode(LIGHT_ENABLE_PIN, OUTPUT);
#endif

#if LIGHT_PROVIDER == LIGHT_PROVIDER_MY9192

_my9291 = new my9291(MY9291_DI_PIN, MY9291_DCKI_PIN, MY9291_COMMAND, MY9291_CHANNELS);
Expand Down
23 changes: 23 additions & 0 deletions code/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,29 @@ upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
monitor_baud = 115200

[env:authometion-lyt8266]
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} -DAUTHOMETION_LYT8266
monitor_baud = 115200

[env:authometion-lyt8266-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} -DAUTHOMETION_LYT8266
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
monitor_baud = 115200

# ------------------------------------------------------------------------------
# GENERIC OTA ENVIRONMENTS
# ------------------------------------------------------------------------------
Expand Down

0 comments on commit 8bad421

Please sign in to comment.