diff --git a/CHANGELOG.md b/CHANGELOG.md index def2c5b3f616..162127dd80ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ All notable changes to this project will be documented in this file. - I2C bus2 support to HYTxxx temperature and humidity sensor - I2C bus2 support to SI1145/6/7 Ultra violet index and light sensor - I2C bus2 support to LM75AD temperature sensor -- Add command ``GpioRead`` +- Command ``GpioRead`` to show input state (#19810) ### Breaking Changed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 2e58c19c8651..cd1fed94f6f4 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -112,7 +112,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ## Changelog v13.2.0.1 ### Added -- Experimental support for ESP32-C2 and ESP32-C6 using Arduino core v3 +- Command ``GpioRead`` to show input state [#19810](https://github.com/arendst/Tasmota/issues/19810) - I2C bus2 support to iAQ core sensor [#19799](https://github.com/arendst/Tasmota/issues/19799) - I2C bus2 support to HTU temperature and humidity sensor - I2C bus2 support to BH1750 ambient light sensor @@ -121,6 +121,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - I2C bus2 support to HYTxxx temperature and humidity sensor - I2C bus2 support to SI1145/6/7 Ultra violet index and light sensor - I2C bus2 support to LM75AD temperature sensor +- Experimental support for ESP32-C2 and ESP32-C6 using Arduino core v3 ### Breaking Changed diff --git a/tasmota/tasmota_support/support_command.ino b/tasmota/tasmota_support/support_command.ino index 34182ebd20e9..1ebcf936cbee 100644 --- a/tasmota/tasmota_support/support_command.ino +++ b/tasmota/tasmota_support/support_command.ino @@ -1768,16 +1768,21 @@ void CmndGpio(void) } } -// Perform a digitalRead on each configured PGIO -void CmndGpioRead(void) -{ +void CmndGpioRead(void) { + // Perform a digitalRead on each configured GPIO myio template_gp; TemplateGpios(&template_gp); bool jsflg = false; Response_P(PSTR("{\"" D_CMND_GPIOREAD "\":{")); for (uint32_t i = 0; i < nitems(Settings->my_gp.io); i++) { - uint32_t sensor_type = template_gp.io[i]; - if ((sensor_type != GPIO_NONE) && (AGPIO(GPIO_USER) != sensor_type)) { + 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) { if (jsflg) { ResponseAppend_P(PSTR(",")); }