Browse Source

Merge branch 'dev' of github.com:xoseperez/espurna into dev

rfm69
Xose Pérez 6 years ago
parent
commit
182150c907
5 changed files with 100 additions and 7 deletions
  1. +2
    -0
      code/espurna/config/general.h
  2. +92
    -4
      code/espurna/config/hardware.h
  3. +1
    -1
      code/espurna/scheduler.ino
  4. +3
    -0
      code/espurna/utils.ino
  5. +2
    -2
      code/html/custom.js

+ 2
- 0
code/espurna/config/general.h View File

@ -181,6 +181,7 @@
#define HEARTBEAT_REPORT_HOSTNAME 1
#define HEARTBEAT_REPORT_APP 1
#define HEARTBEAT_REPORT_VERSION 1
#define HEARTBEAT_REPORT_BOARD 1
#define HEARTBEAT_REPORT_INTERVAL 0
//------------------------------------------------------------------------------
@ -617,6 +618,7 @@ PROGMEM const char* const custom_reset_string[] = {
#define MQTT_TOPIC_UARTIN "uartin"
#define MQTT_TOPIC_UARTOUT "uartout"
#define MQTT_TOPIC_LOADAVG "loadavg"
#define MQTT_TOPIC_BOARD "board"
// Light module
#define MQTT_TOPIC_CHANNEL "channel"


+ 92
- 4
code/espurna/config/hardware.h View File

@ -772,7 +772,6 @@
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
// -----------------------------------------------------------------------------
// YJZK
// -----------------------------------------------------------------------------
@ -1258,7 +1257,6 @@
#define LIGHT_CH3_INVERSE 0
#define LIGHT_CH4_INVERSE 0
#elif defined(ARILUX_AL_LC02)
// Info
@ -1301,7 +1299,6 @@
#define LIGHT_CH4_INVERSE 0
#define LIGHT_CH5_INVERSE 0
#elif defined(ARILUX_AL_LC11)
// Info
@ -1324,7 +1321,6 @@
#define LIGHT_CH4_INVERSE 0
#define LIGHT_CH5_INVERSE 0
#elif defined(ARILUX_E27)
// Info
@ -1590,6 +1586,98 @@
#define LED1_PIN 4
#define LED1_PIN_INVERSE 1
// -----------------------------------------------------------------------------
// HEYGO HY02
// -----------------------------------------------------------------------------
#elif defined(HEYGO_HY02)
// Info
#define MANUFACTURER "HEYGO"
#define DEVICE "HY02"
// Buttons
#define BUTTON1_PIN 13
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// Relays
#define RELAY1_PIN 12
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 0
#define LED1_PIN_INVERSE 0
#define LED2_PIN 15
#define LED2_PIN_INVERSE 0
// HLW8012
#ifndef HLW8012_SUPPORT
#define HLW8012_SUPPORT 1
#endif
#define HLW8012_SEL_PIN 3
#define HLW8012_CF1_PIN 14
#define HLW8012_CF_PIN 5
#define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor
// -----------------------------------------------------------------------------
// Maxcio W-US002S
// -----------------------------------------------------------------------------
#elif defined(MAXCIO_WUS002S)
// Info
#define MANUFACTURER "MAXCIO"
#define DEVICE "WUS002S"
// Buttons
#define BUTTON1_PIN 2
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// Relays
#define RELAY1_PIN 13
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 3
#define LED1_PIN_INVERSE 0
// HLW8012
#ifndef HLW8012_SUPPORT
#define HLW8012_SUPPORT 1
#endif
#define HLW8012_SEL_PIN 12
#define HLW8012_CF1_PIN 5
#define HLW8012_CF_PIN 4
#define HLW8012_CURRENT_R 0.002 // Current resistor
#define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
// -----------------------------------------------------------------------------
// YiDian XS-SSA05
// -----------------------------------------------------------------------------
#elif defined(YIDIAN_XSSSA05)
// Info
#define MANUFACTURER "YIDIAN"
#define DEVICE "XSSSA05"
// Buttons
#define BUTTON1_PIN 13
#define BUTTON1_MODE BUTTON_PUSHBUTTON
#define BUTTON1_RELAY 1
// Relays
#define RELAY1_PIN 12
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 4
#define LED1_PIN_INVERSE 0
// -----------------------------------------------------------------------------
// TEST boards (do not use!!)
// -----------------------------------------------------------------------------


+ 1
- 1
code/espurna/scheduler.ino View File

@ -26,7 +26,7 @@ void _schWebSocketOnSend(JsonObject &root){
scheduler["schEnabled"] = getSetting("schEnabled", i, 1).toInt() == 1;
scheduler["schSwitch"] = getSetting("schSwitch", i, 0).toInt();
scheduler["schAction"] = getSetting("schAction", i, 0).toInt();
scheduler["schType"] = getSetting("schType", i, 0);
scheduler["schType"] = getSetting("schType", i, 0).toInt();
scheduler["schHour"] = getSetting("schHour", i, 0).toInt();
scheduler["schMinute"] = getSetting("schMinute", i, 0).toInt();
scheduler["schWDs"] = getSetting("schWDs", i, "");


+ 3
- 0
code/espurna/utils.ino View File

@ -137,6 +137,9 @@ void heartbeat() {
#if (HEARTBEAT_REPORT_VERSION)
mqttSend(MQTT_TOPIC_VERSION, APP_VERSION);
#endif
#if (HEARTBEAT_REPORT_BOARD)
mqttSend(MQTT_TOPIC_BOARD, getBoardName().c_str());
#endif
#if (HEARTBEAT_REPORT_HOSTNAME)
mqttSend(MQTT_TOPIC_HOSTNAME, getSetting("hostname").c_str());
#endif


+ 2
- 2
code/html/custom.js View File

@ -1349,8 +1349,8 @@ $(function() {
$(".button-add-network").on("click", function() {
$(".more", addNetwork()).toggle();
});
$(".button-add-switch-schedule").on("click", { schType: "1" }, addSchedule);
$(".button-add-light-schedule").on("click", { schType: "2" }, addSchedule);
$(".button-add-switch-schedule").on("click", { schType: 1 }, addSchedule);
$(".button-add-light-schedule").on("click", { schType: 2 }, addSchedule);
$(document).on("change", "input", hasChanged);
$(document).on("change", "select", hasChanged);


Loading…
Cancel
Save