mirror of https://github.com/arendst/Tasmota.git
Save some bytes
This commit is contained in:
parent
57860b692d
commit
0ae793a8d4
|
@ -1775,14 +1775,9 @@ void CmndGpioRead(void) {
|
|||
bool jsflg = false;
|
||||
Response_P(PSTR("{\"" D_CMND_GPIOREAD "\":{"));
|
||||
for (uint32_t i = 0; i < nitems(Settings->my_gp.io); i++) {
|
||||
bool sensor_active = false;
|
||||
uint32_t sensor_type = template_gp.io[i]; // Template GPIO
|
||||
if ((sensor_type != GPIO_NONE) && (AGPIO(GPIO_USER) != sensor_type)) {
|
||||
sensor_active = true;
|
||||
} else if (Settings->my_gp.io[i] != GPIO_NONE) { // Module GPIO
|
||||
sensor_active = true;
|
||||
}
|
||||
if (sensor_active) {
|
||||
uint32_t sensor_type = template_gp.io[i]; // Template GPIO
|
||||
if (((sensor_type != GPIO_NONE) && (AGPIO(GPIO_USER) != sensor_type)) ||
|
||||
(Settings->my_gp.io[i] != GPIO_NONE)) { // Module GPIO
|
||||
if (jsflg) {
|
||||
ResponseAppend_P(PSTR(","));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue