Browse Source

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

rules-rpn
Xose Pérez 5 years ago
parent
commit
24b3aee840
28 changed files with 57 additions and 39 deletions
  1. +1
    -1
      README.md
  2. +1
    -1
      code/espurna/alexa.ino
  3. +1
    -1
      code/espurna/api.ino
  4. +1
    -1
      code/espurna/button.ino
  5. +4
    -0
      code/espurna/config/types.h
  6. +1
    -1
      code/espurna/config/version.h
  7. +1
    -1
      code/espurna/debug.ino
  8. +1
    -1
      code/espurna/domoticz.ino
  9. +1
    -1
      code/espurna/espurna.ino
  10. +1
    -1
      code/espurna/ir.ino
  11. +1
    -1
      code/espurna/led.ino
  12. +1
    -1
      code/espurna/libs/RFM69Wrap.h
  13. +1
    -1
      code/espurna/libs/StreamInjector.h
  14. +1
    -1
      code/espurna/light.ino
  15. +1
    -1
      code/espurna/migrate.ino
  16. +1
    -1
      code/espurna/mqtt.ino
  17. +1
    -1
      code/espurna/nofuss.ino
  18. +1
    -1
      code/espurna/ntp.ino
  19. +1
    -1
      code/espurna/ota.ino
  20. +23
    -10
      code/espurna/relay.ino
  21. +1
    -1
      code/espurna/rfbridge.ino
  22. +1
    -1
      code/espurna/sensor.ino
  23. +1
    -1
      code/espurna/web.ino
  24. +1
    -1
      code/espurna/wifi.ino
  25. +1
    -1
      code/espurna/ws.ino
  26. +1
    -1
      code/gulpfile.js
  27. +3
    -3
      code/html/custom.js
  28. +3
    -2
      code/html/index.html

+ 1
- 1
README.md View File

@ -3,7 +3,7 @@
ESPurna ("spark" in Catalan) is a custom firmware for ESP8285/ESP8266 based smart switches, lights and sensors.
It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries.
[![version](https://img.shields.io/badge/version-1.13.4-brightgreen.svg)](CHANGELOG.md)
[![version](https://img.shields.io/badge/version-1.13.5--dev-brightgreen.svg)](CHANGELOG.md)
[![branch](https://img.shields.io/badge/branch-dev-orange.svg)](https://github.com/xoseperez/espurna/tree/dev/)
[![license](https://img.shields.io/github/license/xoseperez/espurna.svg)](LICENSE)
[![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=dev)](https://travis-ci.org/xoseperez/espurna)


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

@ -2,7 +2,7 @@
ALEXA MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
API MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
BUTTON MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 4
- 0
code/espurna/config/types.h View File

@ -96,6 +96,10 @@
#define RELAY_PROVIDER_RFBRIDGE 3
#define RELAY_PROVIDER_STM 4
#define RELAY_GROUP_SYNC_NORMAL 0
#define RELAY_GROUP_SYNC_INVERSE 1
#define RELAY_GROUP_SYNC_RECEIVEONLY 2
//------------------------------------------------------------------------------
// UDP SYSLOG
//------------------------------------------------------------------------------


+ 1
- 1
code/espurna/config/version.h View File

@ -1,5 +1,5 @@
#define APP_NAME "ESPURNA"
#define APP_VERSION "1.13.4"
#define APP_VERSION "1.13.5-dev"
#define APP_AUTHOR "xose.perez@gmail.com"
#define APP_WEBSITE "http://tinkerman.cat"
#define CFG_VERSION 3

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

@ -2,7 +2,7 @@
DEBUG MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
DOMOTICZ MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
ESPurna
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


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

@ -4,7 +4,7 @@ IR MODULE
Copyright (C) 2018 by Alexander Kolesnikov (raw and MQTT implementation)
Copyright (C) 2017-2018 by François Déchery
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
-----------------------------------------------------------------------------
Configuration


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

@ -2,7 +2,7 @@
LED MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/libs/RFM69Wrap.h View File

@ -3,7 +3,7 @@
RFM69Wrap
RFM69 by Felix Ruso (http://LowPowerLab.com/contact) wrapper for ESP8266
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
code/espurna/libs/StreamInjector.h View File

@ -2,7 +2,7 @@
StreamInjector
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


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

@ -2,7 +2,7 @@
LIGHT MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
MIGRATE MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
MQTT MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
NOFUSS MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
NTP MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
OTA MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 23
- 10
code/espurna/relay.ino View File

@ -2,7 +2,7 @@
RELAY MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/
@ -478,6 +478,12 @@ unsigned char relayParsePayload(const char * payload) {
// BACKWARDS COMPATIBILITY
void _relayBackwards() {
for (unsigned int i=0; i<_relays.size(); i++) {
if (!hasSetting("mqttGroupInv", i)) continue;
setSetting("mqttGroupSync", i, getSetting("mqttGroupInv", i));
delSetting("mqttGroupInv", i);
}
byte relayMode = getSetting("relayMode", RELAY_BOOT_MODE).toInt();
byte relayPulseMode = getSetting("relayPulseMode", RELAY_PULSE_MODE).toInt();
float relayPulseTime = getSetting("relayPulseTime", RELAY_PULSE_TIME).toFloat();
@ -636,7 +642,7 @@ void _relayWebSocketSendRelays() {
#if MQTT_SUPPORT
JsonArray& group = relays.createNestedArray("group");
JsonArray& group_inverse = relays.createNestedArray("group_inv");
JsonArray& group_sync = relays.createNestedArray("group_sync");
JsonArray& on_disconnect = relays.createNestedArray("on_disc");
#endif
@ -652,7 +658,7 @@ void _relayWebSocketSendRelays() {
#if MQTT_SUPPORT
group.add(getSetting("mqttGroup", i, ""));
group_inverse.add(getSetting("mqttGroupInv", i, 0).toInt() == 1);
group_sync.add(getSetting("mqttGroupSync", i, 0).toInt() == 1);
on_disconnect.add(getSetting("relayOnDisc", i, 0).toInt());
#endif
}
@ -807,6 +813,18 @@ void relaySetupAPI() {
#if MQTT_SUPPORT
void _relayMQTTGroup(unsigned char id) {
String topic = getSetting("mqttGroup", id, "");
if (!topic.length()) return;
unsigned char mode = getSetting("mqttGroupSync", id, RELAY_GROUP_SYNC_NORMAL).toInt();
if (mode == RELAY_GROUP_SYNC_RECEIVEONLY) return;
bool status = relayStatus(id);
if (mode == RELAY_GROUP_SYNC_INVERSE) status = !status;
mqttSendRaw(topic.c_str(), status ? RELAY_MQTT_ON : RELAY_MQTT_OFF);
}
void relayMQTT(unsigned char id) {
if (id >= _relays.size()) return;
@ -820,12 +838,7 @@ void relayMQTT(unsigned char id) {
// Check group topic
if (_relays[id].group_report) {
_relays[id].group_report = false;
String t = getSetting("mqttGroup", id, "");
if (t.length() > 0) {
bool status = relayStatus(id);
if (getSetting("mqttGroupInv", id, 0).toInt() == 1) status = !status;
mqttSendRaw(t.c_str(), status ? RELAY_MQTT_ON : RELAY_MQTT_OFF);
}
_relayMQTTGroup(id);
}
// Send speed for IFAN02
@ -952,7 +965,7 @@ void relayMQTTCallback(unsigned int type, const char * topic, const char * paylo
if (value == 0xFF) return;
if (value < 2) {
if (getSetting("mqttGroupInv", i, 0).toInt() == 1) {
if (getSetting("mqttGroupSync", i, RELAY_GROUP_SYNC_NORMAL).toInt() == RELAY_GROUP_SYNC_INVERSE) {
value = 1 - value;
}
}


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

@ -2,7 +2,7 @@
RF MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
SENSOR MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
WEBSERVER MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
WIFI MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


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

@ -2,7 +2,7 @@
WEBSOCKET MODULE
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/gulpfile.js View File

@ -2,7 +2,7 @@
ESP8266 file system builder
Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


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

@ -246,7 +246,7 @@ function addValue(data, name, value) {
"ssid", "pass", "gw", "mask", "ip", "dns",
"schEnabled", "schSwitch","schAction","schType","schHour","schMinute","schWDs","schUTC",
"relayBoot", "relayPulse", "relayTime",
"mqttGroup", "mqttGroupInv", "relayOnDisc",
"mqttGroup", "mqttGroupSync", "relayOnDisc",
"dczRelayIdx", "dczMagnitude",
"tspkRelay", "tspkMagnitude",
"ledMode",
@ -958,8 +958,8 @@ function initRelayConfig(data) {
if ("group" in data) {
$("input[name='mqttGroup']", line).val(data.group[i]);
}
if ("group_inv" in data) {
$("input[name='mqttGroupInv']", line).val(data.group_inv[i]);
if ("group_sync" in data) {
$("input[name='mqttGroupSync']", line).val(data.group_sync[i]);
}
if ("on_disc" in data) {
$("input[name='relayOnDisc']", line).val(data.on_disc[i]);


+ 3
- 2
code/html/index.html View File

@ -181,7 +181,7 @@
</div>
<div class="footer">
&copy; 2016-2018<br />
&copy; 2016-2019<br />
Xose Pérez<br/>
<a href="https://twitter.com/xoseperez" target="_blank">@xoseperez</a><br/>
<a href="http://tinkerman.cat" target="_blank">http://tinkerman.cat</a><br/>
@ -1636,9 +1636,10 @@
</div>
<div class="pure-g module module-mqtt">
<div class="pure-u-1 pure-u-lg-1-4"><label>MQTT group sync</label></div>
<select class="pure-u-1 pure-u-lg-3-4" name="mqttGroupInv">
<select class="pure-u-1 pure-u-lg-3-4" name="mqttGroupSync">
<option value="0">Same</option>
<option value="1">Inverse</option>
<option value="2">Receive Only</option>
</select>
</div>
<div class="pure-g module module-mqtt">


Loading…
Cancel
Save