mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
v5.8.0l - Update module config webpage
5.8.0l * Update HTML/CSS to enable nicer form field entry * Fix inverted relay status after restart or power on as regression from 5.8.0d (#909) * Add send protocol Panasonic to IRsend (#1014) * Fix relay power control when light power control is also configured as regression from 5.8.0 (#1016)
This commit is contained in:
parent
766e05b997
commit
66d9ff14ac
@ -1,7 +1,7 @@
|
|||||||
## Sonoff-Tasmota
|
## Sonoff-Tasmota
|
||||||
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
|
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
|
||||||
|
|
||||||
Current version is **5.8.0k** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
|
Current version is **5.8.0l** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
|
||||||
|
|
||||||
### ATTENTION All versions
|
### ATTENTION All versions
|
||||||
|
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
/* 5.8.0k
|
/* 5.8.0l
|
||||||
|
* Update HTML/CSS to enable nicer form field entry
|
||||||
|
* Fix inverted relay status after restart or power on as regression from 5.8.0d (#909)
|
||||||
|
* Add send protocol Panasonic to IRsend (#1014)
|
||||||
|
* Fix relay power control when light power control is also configured as regression from 5.8.0 (#1016)
|
||||||
|
*
|
||||||
|
* 5.8.0k
|
||||||
* Add support for up to 8 relays (#995)
|
* Add support for up to 8 relays (#995)
|
||||||
* Fix Blocked Loop when erasing large flash using command reset 2 (#1002)
|
* Fix Blocked Loop when erasing large flash using command reset 2 (#1002)
|
||||||
* Add retain to ENERGY messages controlled by command SensorRetain (#1013)
|
* Add retain to ENERGY messages controlled by command SensorRetain (#1013)
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
|
||||||
typedef unsigned long power_t; // Power (Relay) type
|
typedef unsigned long power_t; // Power (Relay) type
|
||||||
#define POWER_MASK 0xFFFFFFFF // Power (Relay) full mask
|
#define POWER_MASK 0xffffffffUL // Power (Relay) full mask
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* Defines
|
* Defines
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
|
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
|
||||||
====================================================*/
|
====================================================*/
|
||||||
|
|
||||||
#define VERSION 0x0508000B // 5.8.0k
|
#define VERSION 0x0508000C // 5.8.0l
|
||||||
|
|
||||||
#include "sonoff.h"
|
#include "sonoff.h"
|
||||||
#include "user_config.h"
|
#include "user_config.h"
|
||||||
@ -352,6 +352,9 @@ void setRelay(power_t rpower)
|
|||||||
rpower = 0;
|
rpower = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (sfl_flg) {
|
||||||
|
sl_setPower(rpower);
|
||||||
|
}
|
||||||
if ((SONOFF_DUAL == sysCfg.module) || (CH4 == sysCfg.module)) {
|
if ((SONOFF_DUAL == sysCfg.module) || (CH4 == sysCfg.module)) {
|
||||||
Serial.write(0xA0);
|
Serial.write(0xA0);
|
||||||
Serial.write(0x04);
|
Serial.write(0x04);
|
||||||
@ -360,13 +363,18 @@ void setRelay(power_t rpower)
|
|||||||
Serial.write('\n');
|
Serial.write('\n');
|
||||||
Serial.flush();
|
Serial.flush();
|
||||||
}
|
}
|
||||||
else if (sfl_flg) {
|
|
||||||
sl_setPower(rpower);
|
|
||||||
}
|
|
||||||
else if (EXS_RELAY == sysCfg.module) {
|
else if (EXS_RELAY == sysCfg.module) {
|
||||||
setLatchingRelay(rpower, 1);
|
setLatchingRelay(rpower, 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
for (byte i = 0; i < Maxdevice; i++) {
|
||||||
|
state = rpower &1;
|
||||||
|
if ((i < MAX_RELAYS) && (pin[GPIO_REL1 +i] < 99)) {
|
||||||
|
digitalWrite(pin[GPIO_REL1 +i], bitRead(rel_inverted, i) ? !state : state);
|
||||||
|
}
|
||||||
|
rpower >>= 1;
|
||||||
|
}
|
||||||
|
/*
|
||||||
uint8_t maxdev = (Maxdevice > MAX_RELAYS) ? MAX_RELAYS : Maxdevice;
|
uint8_t maxdev = (Maxdevice > MAX_RELAYS) ? MAX_RELAYS : Maxdevice;
|
||||||
for (byte i = 0; i < maxdev; i++) {
|
for (byte i = 0; i < maxdev; i++) {
|
||||||
state = rpower &1;
|
state = rpower &1;
|
||||||
@ -375,6 +383,7 @@ void setRelay(power_t rpower)
|
|||||||
}
|
}
|
||||||
rpower >>= 1;
|
rpower >>= 1;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
hlw_setPowerSteadyCounter(2);
|
hlw_setPowerSteadyCounter(2);
|
||||||
}
|
}
|
||||||
@ -750,7 +759,7 @@ boolean mqtt_command(boolean grpflg, char *type, uint16_t index, char *dataBuf,
|
|||||||
if ((payload >= 0) && (payload <= 1)) {
|
if ((payload >= 0) && (payload <= 1)) {
|
||||||
strlcpy(sysCfg.button_topic, sysCfg.mqtt_topic, sizeof(sysCfg.button_topic));
|
strlcpy(sysCfg.button_topic, sysCfg.mqtt_topic, sizeof(sysCfg.button_topic));
|
||||||
if (!payload) {
|
if (!payload) {
|
||||||
for(i = 1; i <= Maxdevice; i++) {
|
for(i = 1; i <= MAX_KEYS; i++) {
|
||||||
send_button_power(0, i, 9); // Clear MQTT retain in broker
|
send_button_power(0, i, 9); // Clear MQTT retain in broker
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2722,7 +2731,6 @@ extern struct rst_info resetInfo;
|
|||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
byte idx;
|
byte idx;
|
||||||
uint8_t maxdev;
|
|
||||||
|
|
||||||
Serial.begin(Baudrate);
|
Serial.begin(Baudrate);
|
||||||
delay(10);
|
delay(10);
|
||||||
@ -2815,19 +2823,13 @@ void setup()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Issue #526
|
// Issue #526 and #909
|
||||||
maxdev = (Maxdevice > MAX_RELAYS) ? MAX_RELAYS : Maxdevice;
|
for (byte i = 0; i < Maxdevice; i++) {
|
||||||
for (byte i = 0; i < maxdev; i++) {
|
if ((i < MAX_RELAYS) && (pin[GPIO_REL1 +i] < 99)) {
|
||||||
if (pin[GPIO_REL1 +i] < 99) {
|
bitWrite(power, i, digitalRead(pin[GPIO_REL1 +i]) ^ bitRead(rel_inverted, i));
|
||||||
if (digitalRead(pin[GPIO_REL1 +i]) ^ bitRead(rel_inverted, i)) {
|
|
||||||
bitSet(power, i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
if ((i < MAX_PULSETIMERS) && bitRead(power, i)) {
|
||||||
maxdev = (Maxdevice > MAX_PULSETIMERS) ? MAX_PULSETIMERS : Maxdevice;
|
pulse_timer[i] = sysCfg.pulsetime[i];
|
||||||
for (byte i = 0; i < maxdev; i++) {
|
|
||||||
if (bitRead(power, i)) {
|
|
||||||
pulse_timer[i] = sysCfg.pulsetime[i]; // MAX_PULSETIMERS must be equal to MAX_RELAYS for this to work here
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,6 +195,8 @@ enum module_t {
|
|||||||
|
|
||||||
#define MAX_GPIO_PIN 18 // Number of supported GPIO
|
#define MAX_GPIO_PIN 18 // Number of supported GPIO
|
||||||
|
|
||||||
|
const char PINS_WEMOS[] PROGMEM = "D3TXD4RXD2D1flashcontrolD6D7D5D8D0A0";
|
||||||
|
|
||||||
typedef struct MYIO {
|
typedef struct MYIO {
|
||||||
uint8_t io[MAX_GPIO_PIN];
|
uint8_t io[MAX_GPIO_PIN];
|
||||||
} myio;
|
} myio;
|
||||||
|
@ -77,7 +77,7 @@ const char HTTP_HEAD[] PROGMEM =
|
|||||||
|
|
||||||
"<style>"
|
"<style>"
|
||||||
"div,fieldset,input,select{padding:5px;font-size:1em;}"
|
"div,fieldset,input,select{padding:5px;font-size:1em;}"
|
||||||
"input{width:95%;}"
|
"input{width:100%;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;}"
|
||||||
"select{width:100%;}"
|
"select{width:100%;}"
|
||||||
"textarea{resize:none;width:98%;height:318px;padding:5px;overflow:auto;}"
|
"textarea{resize:none;width:98%;height:318px;padding:5px;overflow:auto;}"
|
||||||
"body{text-align:center;font-family:verdana;}"
|
"body{text-align:center;font-family:verdana;}"
|
||||||
@ -173,6 +173,7 @@ const char HTTP_BTN_MENU3[] PROGMEM =
|
|||||||
const char HTTP_BTN_MENU4[] PROGMEM =
|
const char HTTP_BTN_MENU4[] PROGMEM =
|
||||||
"<br/><form action='lg' method='get'><button>" D_CONFIGURE_LOGGING "</button></form>"
|
"<br/><form action='lg' method='get'><button>" D_CONFIGURE_LOGGING "</button></form>"
|
||||||
"<br/><form action='co' method='get'><button>" D_CONFIGURE_OTHER "</button></form>"
|
"<br/><form action='co' method='get'><button>" D_CONFIGURE_OTHER "</button></form>"
|
||||||
|
"<br/>"
|
||||||
"<br/><form action='rt' method='get' onsubmit='return confirm(\"" D_CONFIRM_RESET_CONFIGURATION "\");'><button>" D_RESET_CONFIGURATION "</button></form>"
|
"<br/><form action='rt' method='get' onsubmit='return confirm(\"" D_CONFIRM_RESET_CONFIGURATION "\");'><button>" D_RESET_CONFIGURATION "</button></form>"
|
||||||
"<br/><form action='dl' method='get'><button>" D_BACKUP_CONFIGURATION "</button></form>"
|
"<br/><form action='dl' method='get'><button>" D_BACKUP_CONFIGURATION "</button></form>"
|
||||||
"<br/><form action='rs' method='get'><button>" D_RESTORE_CONFIGURATION "</button></form>";
|
"<br/><form action='rs' method='get'><button>" D_RESTORE_CONFIGURATION "</button></form>";
|
||||||
@ -191,21 +192,21 @@ const char HTTP_LNK_SCAN[] PROGMEM =
|
|||||||
const char HTTP_FORM_WIFI[] PROGMEM =
|
const char HTTP_FORM_WIFI[] PROGMEM =
|
||||||
"<fieldset><legend><b> " D_WIFI_PARAMETERS " </b></legend><form method='get' action='sv'>"
|
"<fieldset><legend><b> " D_WIFI_PARAMETERS " </b></legend><form method='get' action='sv'>"
|
||||||
"<input id='w' name='w' value='1' hidden><input id='r' name='r' value='1' hidden>"
|
"<input id='w' name='w' value='1' hidden><input id='r' name='r' value='1' hidden>"
|
||||||
"<br/><b>" D_AP1_SSID "</b> (" STA_SSID1 ")<br/><input id='s1' name='s1' length=32 placeholder='" STA_SSID1 "' value='{s1}'><br/>"
|
"<br/><b>" D_AP1_SSID "</b> (" STA_SSID1 ")<br/><input id='s1' name='s1' placeholder='" STA_SSID1 "' value='{s1}'><br/>"
|
||||||
"<br/><b>" D_AP1_PASSWORD "</b></br><input id='p1' name='p1' length=64 type='password' placeholder='" STA_PASS1 "' value='{p1}'><br/>"
|
"<br/><b>" D_AP1_PASSWORD "</b></br><input id='p1' name='p1' type='password' placeholder='" STA_PASS1 "' value='{p1}'><br/>"
|
||||||
"<br/><b>" D_AP2_SSID "</b> (" STA_SSID2 ")<br/><input id='s2' name='s2' length=32 placeholder='" STA_SSID2 "' value='{s2}'><br/>"
|
"<br/><b>" D_AP2_SSID "</b> (" STA_SSID2 ")<br/><input id='s2' name='s2' placeholder='" STA_SSID2 "' value='{s2}'><br/>"
|
||||||
"<br/><b>" D_AP2_PASSWORD "</b></br><input id='p2' name='p2' length=64 type='password' placeholder='" STA_PASS2 "' value='{p2}'><br/>"
|
"<br/><b>" D_AP2_PASSWORD "</b></br><input id='p2' name='p2' type='password' placeholder='" STA_PASS2 "' value='{p2}'><br/>"
|
||||||
"<br/><b>" D_HOSTNAME "</b> (" WIFI_HOSTNAME ")<br/><input id='h' name='h' length=32 placeholder='" WIFI_HOSTNAME" ' value='{h1}'><br/>";
|
"<br/><b>" D_HOSTNAME "</b> (" WIFI_HOSTNAME ")<br/><input id='h' name='h' placeholder='" WIFI_HOSTNAME" ' value='{h1}'><br/>";
|
||||||
const char HTTP_FORM_MQTT[] PROGMEM =
|
const char HTTP_FORM_MQTT[] PROGMEM =
|
||||||
"<fieldset><legend><b> " D_MQTT_PARAMETERS " </b></legend><form method='get' action='sv'>"
|
"<fieldset><legend><b> " D_MQTT_PARAMETERS " </b></legend><form method='get' action='sv'>"
|
||||||
"<input id='w' name='w' value='2' hidden><input id='r' name='r' value='1' hidden>"
|
"<input id='w' name='w' value='2' hidden><input id='r' name='r' value='1' hidden>"
|
||||||
"<br/><b>" D_HOST "</b> (" MQTT_HOST ")<br/><input id='mh' name='mh' length=32 placeholder='" MQTT_HOST" ' value='{m1}'><br/>"
|
"<br/><b>" D_HOST "</b> (" MQTT_HOST ")<br/><input id='mh' name='mh' placeholder='" MQTT_HOST" ' value='{m1}'><br/>"
|
||||||
"<br/><b>" D_PORT "</b> (" STR(MQTT_PORT) ")<br/><input id='ml' name='ml' length=5 placeholder='" STR(MQTT_PORT) "' value='{m2}'><br/>"
|
"<br/><b>" D_PORT "</b> (" STR(MQTT_PORT) ")<br/><input id='ml' name='ml' placeholder='" STR(MQTT_PORT) "' value='{m2}'><br/>"
|
||||||
"<br/><b>" D_CLIENT "</b> ({m0})<br/><input id='mc' name='mc' length=32 placeholder='" MQTT_CLIENT_ID "' value='{m3}'><br/>"
|
"<br/><b>" D_CLIENT "</b> ({m0})<br/><input id='mc' name='mc' placeholder='" MQTT_CLIENT_ID "' value='{m3}'><br/>"
|
||||||
"<br/><b>" D_USER "</b> (" MQTT_USER ")<br/><input id='mu' name='mu' length=32 placeholder='" MQTT_USER "' value='{m4}'><br/>"
|
"<br/><b>" D_USER "</b> (" MQTT_USER ")<br/><input id='mu' name='mu' placeholder='" MQTT_USER "' value='{m4}'><br/>"
|
||||||
"<br/><b>" D_PASSWORD "</b><br/><input id='mp' name='mp' length=32 type='password' placeholder='" MQTT_PASS "' value='{m5}'><br/>"
|
"<br/><b>" D_PASSWORD "</b><br/><input id='mp' name='mp' type='password' placeholder='" MQTT_PASS "' value='{m5}'><br/>"
|
||||||
"<br/><b>" D_TOPIC "</b> = %topic% (" MQTT_TOPIC ")<br/><input id='mt' name='mt' length=32 placeholder='" MQTT_TOPIC" ' value='{m6}'><br/>"
|
"<br/><b>" D_TOPIC "</b> = %topic% (" MQTT_TOPIC ")<br/><input id='mt' name='mt' placeholder='" MQTT_TOPIC" ' value='{m6}'><br/>"
|
||||||
"<br/><b>" D_FULL_TOPIC "</b> (" MQTT_FULLTOPIC ")<br/><input id='mf' name='mf' length=80 placeholder='" MQTT_FULLTOPIC" ' value='{m7}'><br/>";
|
"<br/><b>" D_FULL_TOPIC "</b> (" MQTT_FULLTOPIC ")<br/><input id='mf' name='mf' placeholder='" MQTT_FULLTOPIC" ' value='{m7}'><br/>";
|
||||||
const char HTTP_FORM_LOG1[] PROGMEM =
|
const char HTTP_FORM_LOG1[] PROGMEM =
|
||||||
"<fieldset><legend><b> " D_LOGGING_PARAMETERS " </b></legend><form method='get' action='sv'>"
|
"<fieldset><legend><b> " D_LOGGING_PARAMETERS " </b></legend><form method='get' action='sv'>"
|
||||||
"<input id='w' name='w' value='3' hidden><input id='r' name='r' value='0' hidden>";
|
"<input id='w' name='w' value='3' hidden><input id='r' name='r' value='0' hidden>";
|
||||||
@ -218,16 +219,16 @@ const char HTTP_FORM_LOG2[] PROGMEM =
|
|||||||
"<option{a4value='4'>4 " D_MORE_DEBUG "</option>"
|
"<option{a4value='4'>4 " D_MORE_DEBUG "</option>"
|
||||||
"</select></br>";
|
"</select></br>";
|
||||||
const char HTTP_FORM_LOG3[] PROGMEM =
|
const char HTTP_FORM_LOG3[] PROGMEM =
|
||||||
"<br/><b>" D_SYSLOG_HOST "</b> (" SYS_LOG_HOST ")<br/><input id='lh' name='lh' length=32 placeholder='" SYS_LOG_HOST "' value='{l2}'><br/>"
|
"<br/><b>" D_SYSLOG_HOST "</b> (" SYS_LOG_HOST ")<br/><input id='lh' name='lh' placeholder='" SYS_LOG_HOST "' value='{l2}'><br/>"
|
||||||
"<br/><b>" D_SYSLOG_PORT "</b> (" STR(SYS_LOG_PORT) ")<br/><input id='lp' name='lp' length=5 placeholder='" STR(SYS_LOG_PORT) "' value='{l3}'><br/>"
|
"<br/><b>" D_SYSLOG_PORT "</b> (" STR(SYS_LOG_PORT) ")<br/><input id='lp' name='lp' placeholder='" STR(SYS_LOG_PORT) "' value='{l3}'><br/>"
|
||||||
"<br/><b>" D_TELEMETRY_PERIOD "</b> (" STR(TELE_PERIOD) ")<br/><input id='lt' name='lt' length=4 placeholder='" STR(TELE_PERIOD) "' value='{l4}'><br/>";
|
"<br/><b>" D_TELEMETRY_PERIOD "</b> (" STR(TELE_PERIOD) ")<br/><input id='lt' name='lt' placeholder='" STR(TELE_PERIOD) "' value='{l4}'><br/>";
|
||||||
const char HTTP_FORM_OTHER[] PROGMEM =
|
const char HTTP_FORM_OTHER[] PROGMEM =
|
||||||
"<fieldset><legend><b> " D_OTHER_PARAMETERS " </b></legend><form method='get' action='sv'>"
|
"<fieldset><legend><b> " D_OTHER_PARAMETERS " </b></legend><form method='get' action='sv'>"
|
||||||
"<input id='w' name='w' value='5' hidden><input id='r' name='r' value='1' hidden>"
|
"<input id='w' name='w' value='5' hidden><input id='r' name='r' value='1' hidden>"
|
||||||
"<br/><b>" D_WEB_ADMIN_PASSWORD "</b><br/><input id='p1' name='p1' length=32 type='password' placeholder='" WEB_PASSWORD "' value='{p1}'><br/>"
|
"<br/><b>" D_WEB_ADMIN_PASSWORD "</b><br/><input id='p1' name='p1' type='password' placeholder='" WEB_PASSWORD "' value='{p1}'><br/>"
|
||||||
"<br/><input style='width:10%;' id='b1' name='b1' type='checkbox'{r1}><b>" D_MQTT_ENABLE "</b><br/>";
|
"<br/><input style='width:10%;' id='b1' name='b1' type='checkbox'{r1}><b>" D_MQTT_ENABLE "</b><br/>";
|
||||||
const char HTTP_FORM_OTHER2[] PROGMEM =
|
const char HTTP_FORM_OTHER2[] PROGMEM =
|
||||||
"<br/><b>" D_FRIENDLY_NAME " {1</b> ({2)<br/><input id='a{1' name='a{1' length=32 placeholder='{2' value='{3'><br/>";
|
"<br/><b>" D_FRIENDLY_NAME " {1</b> ({2)<br/><input id='a{1' name='a{1' placeholder='{2' value='{3'><br/>";
|
||||||
#ifdef USE_EMULATION
|
#ifdef USE_EMULATION
|
||||||
const char HTTP_FORM_OTHER3a[] PROGMEM =
|
const char HTTP_FORM_OTHER3a[] PROGMEM =
|
||||||
"<br/><fieldset><legend><b> " D_EMULATION " </b></legend>";
|
"<br/><fieldset><legend><b> " D_EMULATION " </b></legend>";
|
||||||
@ -243,7 +244,7 @@ const char HTTP_FORM_UPG[] PROGMEM =
|
|||||||
"<div id='f1' name='f1' style='display:block;'>"
|
"<div id='f1' name='f1' style='display:block;'>"
|
||||||
"<fieldset><legend><b> " D_UPGRADE_BY_WEBSERVER " </b></legend>"
|
"<fieldset><legend><b> " D_UPGRADE_BY_WEBSERVER " </b></legend>"
|
||||||
"<form method='get' action='u1'>"
|
"<form method='get' action='u1'>"
|
||||||
"<br/>" D_OTA_URL "<br/><input id='o' name='o' length=80 placeholder='OTA_URL' value='{o1}'><br/>"
|
"<br/>" D_OTA_URL "<br/><input id='o' name='o' placeholder='OTA_URL' value='{o1}'><br/>"
|
||||||
"<br/><button type='submit'>" D_START_UPGRADE "</button></form>"
|
"<br/><button type='submit'>" D_START_UPGRADE "</button></form>"
|
||||||
"</fieldset><br/><br/>"
|
"</fieldset><br/><br/>"
|
||||||
"<fieldset><legend><b> " D_UPGRADE_BY_FILE_UPLOAD " </b></legend>";
|
"<fieldset><legend><b> " D_UPGRADE_BY_FILE_UPLOAD " </b></legend>";
|
||||||
@ -257,8 +258,8 @@ const char HTTP_FORM_RST_UPG[] PROGMEM =
|
|||||||
const char HTTP_FORM_CMND[] PROGMEM =
|
const char HTTP_FORM_CMND[] PROGMEM =
|
||||||
"<br/><textarea readonly id='t1' name='t1' cols='" STR(MESSZ) "' wrap='off'></textarea><br/><br/>"
|
"<br/><textarea readonly id='t1' name='t1' cols='" STR(MESSZ) "' wrap='off'></textarea><br/><br/>"
|
||||||
"<form method='get' onsubmit='return l(1);'>"
|
"<form method='get' onsubmit='return l(1);'>"
|
||||||
"<input style='width:98%' id='c1' name='c1' length='99' placeholder='" D_ENTER_COMMAND "' autofocus><br/>"
|
"<input id='c1' name='c1' placeholder='" D_ENTER_COMMAND "' autofocus><br/>"
|
||||||
// "<br/><button type='submit'>Send command</button>"
|
// "<br/><button type='submit'>Send command</button>"
|
||||||
"</form>";
|
"</form>";
|
||||||
const char HTTP_TABLE100[] PROGMEM =
|
const char HTTP_TABLE100[] PROGMEM =
|
||||||
"<table style='width:100%'>";
|
"<table style='width:100%'>";
|
||||||
@ -704,15 +705,20 @@ void handleModule()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
func += FPSTR(HTTP_SCRIPT_MODULE3);
|
func += FPSTR(HTTP_SCRIPT_MODULE3);
|
||||||
|
|
||||||
|
page += F("<br/><table>");
|
||||||
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
|
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
|
||||||
if (GPIO_USER == cmodule.gp.io[i]) {
|
if (GPIO_USER == cmodule.gp.io[i]) {
|
||||||
snprintf_P(line, sizeof(line), PSTR("<br/><b>" D_GPIO "%d</b> %s<select id='g%d' name='g%d'></select></br>"),
|
snprintf_P(stemp, 3, PINS_WEMOS +i*2);
|
||||||
i, (0==i)? D_SENSOR_BUTTON "1":(1==i)? D_SERIAL_OUT :(3==i)? D_SERIAL_IN :(12==i)? D_SENSOR_RELAY "1":(13==i)? D_SENSOR_LED "1i":(14==i)? D_SENSOR :"", i, i);
|
snprintf_P(line, sizeof(line), PSTR("<tr><td width='190'>%s <b>" D_GPIO "%d</b> %s</td><td width='126'><select id='g%d' name='g%d'></select></td></tr>"),
|
||||||
|
(WEMOS==sysCfg.module)?stemp:"", i, (0==i)? D_SENSOR_BUTTON "1":(1==i)? D_SERIAL_OUT :(3==i)? D_SERIAL_IN :(12==i)? D_SENSOR_RELAY "1":(13==i)? D_SENSOR_LED "1i":(14==i)? D_SENSOR :"", i, i);
|
||||||
page += line;
|
page += line;
|
||||||
snprintf_P(line, sizeof(line), PSTR("sk(%d,%d);"), my_module.gp.io[i], i); // g0 - g16
|
snprintf_P(line, sizeof(line), PSTR("sk(%d,%d);"), my_module.gp.io[i], i); // g0 - g16
|
||||||
func += line;
|
func += line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
page += F("</table>");
|
||||||
|
|
||||||
func += F("}</script>");
|
func += F("}</script>");
|
||||||
page.replace(F("</script>"), func);
|
page.replace(F("</script>"), func);
|
||||||
page.replace(F("<body>"), F("<body onload='sl()'>"));
|
page.replace(F("<body>"), F("<body onload='sl()'>"));
|
||||||
|
@ -23,16 +23,16 @@
|
|||||||
const char HTTP_FORM_DOMOTICZ[] PROGMEM =
|
const char HTTP_FORM_DOMOTICZ[] PROGMEM =
|
||||||
"<fieldset><legend><b> " D_DOMOTICZ_PARAMETERS " </b></legend><form method='post' action='sv'>"
|
"<fieldset><legend><b> " D_DOMOTICZ_PARAMETERS " </b></legend><form method='post' action='sv'>"
|
||||||
"<input id='w' name='w' value='4' hidden><input id='r' name='r' value='1' hidden>"
|
"<input id='w' name='w' value='4' hidden><input id='r' name='r' value='1' hidden>"
|
||||||
"<br/><table style='width:97%'>";
|
"<br/><table>";
|
||||||
const char HTTP_FORM_DOMOTICZ_RELAY[] PROGMEM =
|
const char HTTP_FORM_DOMOTICZ_RELAY[] PROGMEM =
|
||||||
"<tr><td><b>" D_DOMOTICZ_IDX " {1</b></td></td><td width='20%'><input id='r{1' name='r{1' length=8 placeholder='0' value='{2'></td></tr>"
|
"<tr><td width='260'><b>" D_DOMOTICZ_IDX " {1</b></td><td width='70'><input id='r{1' name='r{1' placeholder='0' value='{2'></td></tr>"
|
||||||
"<tr><td><b>" D_DOMOTICZ_KEY_IDX " {1</b></td><td><input id='k{1' name='k{1' length=8 placeholder='0' value='{3'></td></tr>";
|
"<tr><td width='260'><b>" D_DOMOTICZ_KEY_IDX " {1</b></td><td width='70'><input id='k{1' name='k{1' placeholder='0' value='{3'></td></tr>";
|
||||||
const char HTTP_FORM_DOMOTICZ_SWITCH[] PROGMEM =
|
const char HTTP_FORM_DOMOTICZ_SWITCH[] PROGMEM =
|
||||||
"<tr><td><b>" D_DOMOTICZ_SWITCH_IDX " {1</b></td><td width='20%'><input id='s{1' name='s{1' length=8 placeholder='0' value='{4'></td></tr>";
|
"<tr><td width='260'><b>" D_DOMOTICZ_SWITCH_IDX " {1</b></td><td width='70'><input id='s{1' name='s{1' placeholder='0' value='{4'></td></tr>";
|
||||||
const char HTTP_FORM_DOMOTICZ_SENSOR[] PROGMEM =
|
const char HTTP_FORM_DOMOTICZ_SENSOR[] PROGMEM =
|
||||||
"<tr><td><b>" D_DOMOTICZ_SENSOR_IDX " {1</b> - {2</td><td width='20%'><input id='l{1' name='l{1' length=8 placeholder='0' value='{5'></td></tr>";
|
"<tr><td width='260'><b>" D_DOMOTICZ_SENSOR_IDX " {1</b> {2</td><td width='70'><input id='l{1' name='l{1' placeholder='0' value='{5'></td></tr>";
|
||||||
const char HTTP_FORM_DOMOTICZ_TIMER[] PROGMEM =
|
const char HTTP_FORM_DOMOTICZ_TIMER[] PROGMEM =
|
||||||
"<tr><td><b>" D_DOMOTICZ_UPDATE_TIMER "</b> (" STR(DOMOTICZ_UPDATE_TIMER) ")</td><td><input id='ut' name='ut' length=32 placeholder='" STR(DOMOTICZ_UPDATE_TIMER) "' value='{6'</td></tr>";
|
"<tr><td width='260'><b>" D_DOMOTICZ_UPDATE_TIMER "</b> (" STR(DOMOTICZ_UPDATE_TIMER) ")</td><td width='70'><input id='ut' name='ut' placeholder='" STR(DOMOTICZ_UPDATE_TIMER) "' value='{6'</td></tr>";
|
||||||
#endif // USE_WEBSERVER
|
#endif // USE_WEBSERVER
|
||||||
|
|
||||||
enum domoticz_sensors_t {
|
enum domoticz_sensors_t {
|
||||||
|
@ -322,6 +322,8 @@ boolean ir_send_command(char *type, uint16_t index, char *dataBuf, uint16_t data
|
|||||||
irsend->sendJVC(data, bits, 1);
|
irsend->sendJVC(data, bits, 1);
|
||||||
else if (!strcasecmp_P(protocol, PSTR("SAMSUNG")))
|
else if (!strcasecmp_P(protocol, PSTR("SAMSUNG")))
|
||||||
irsend->sendSAMSUNG(data, bits);
|
irsend->sendSAMSUNG(data, bits);
|
||||||
|
else if (!strcasecmp_P(protocol, PSTR("PANASONIC")))
|
||||||
|
irsend->sendPanasonic(data, bits);
|
||||||
else {
|
else {
|
||||||
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_IRSEND "\":\"" D_PROTOCOL_NOT_SUPPORTED "\"}"));
|
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_IRSEND "\":\"" D_PROTOCOL_NOT_SUPPORTED "\"}"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user