Fix KNX buttons, switches and sensors detection

Fix KNX buttons, switches and sensors detection regression from v9.1.0 (#9811)
This commit is contained in:
Theo Arends 2020-11-13 11:21:28 +01:00
parent 9915c9e731
commit 14034ee9d1
3 changed files with 23 additions and 29 deletions

View File

@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- NTP fallback server functionality (#9739)
- Telegram group chatid not supported (#9831)
- KNX buttons, switches and sensors detection regression from v9.1.0 (#9811)
### Removed
- Version compatibility check

View File

@ -73,6 +73,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
### Fixed
- NTP fallback server functionality (#9739)
- Telegram group chatid not supported (#9831)
- KNX buttons, switches and sensors detection regression from v9.1.0 (#9811)
### Removed
- Version compatibility check

View File

@ -466,43 +466,35 @@ void KNX_INIT(void)
// Read Configuration
// Check which relays, buttons and sensors where configured for this device
// and activate options according to the hardware
/*for (uint32_t i = GPIO_REL1; i < GPIO_REL8 + 1; ++i)
{
if (GetUsedInModule(i, TasmotaGlobal.my_module.io)) { device_param[i - GPIO_REL1].show = true; }
/*
for (uint32_t i = 0; i < 8; i++) {
if (PinUsed(GPIO_REL1, i)) {
device_param[i].show = true;
}
}
for (uint32_t i = GPIO_REL1_INV; i < GPIO_REL8_INV + 1; ++i)
{
if (GetUsedInModule(i, TasmotaGlobal.my_module.io)) { device_param[i - GPIO_REL1_INV].show = true; }
}*/
for (uint32_t i = 0; i < TasmotaGlobal.devices_present; ++i)
{
*/
for (uint32_t i = 0; i < TasmotaGlobal.devices_present; ++i) {
device_param[i].show = true;
}
for (uint32_t i = GPIO_SWT1; i < GPIO_SWT1 + 4; ++i)
{
if (GetUsedInModule(i, TasmotaGlobal.my_module.io)) { device_param[i - GPIO_SWT1 + 8].show = true; }
for (uint32_t i = 0; i < 4; i++) {
if (PinUsed(GPIO_KEY1, i)) {
device_param[8 + i].show = true;
}
}
for (uint32_t i = GPIO_KEY1; i < GPIO_KEY1 + 4; ++i)
{
if (GetUsedInModule(i, TasmotaGlobal.my_module.io)) { device_param[i - GPIO_KEY1 + 8].show = true; }
for (uint32_t i = 0; i < 8; i++) {
if (PinUsed(GPIO_SWT1, i)) {
device_param[8 + i].show = true;
}
}
for (uint32_t i = GPIO_SWT1_NP; i < GPIO_SWT1_NP + 4; ++i)
{
if (GetUsedInModule(i, TasmotaGlobal.my_module.io)) { device_param[i - GPIO_SWT1_NP + 8].show = true; }
if (PinUsed(GPIO_DHT11) || PinUsed(GPIO_DHT22) || PinUsed(GPIO_SI7021)) {
device_param[KNX_TEMPERATURE-1].show = true;
device_param[KNX_HUMIDITY-1].show = true;
}
for (uint32_t i = GPIO_KEY1_NP; i < GPIO_KEY1_NP + 4; ++i)
{
if (GetUsedInModule(i, TasmotaGlobal.my_module.io)) { device_param[i - GPIO_KEY1_NP + 8].show = true; }
}
if (GetUsedInModule(GPIO_DHT11, TasmotaGlobal.my_module.io)) { device_param[KNX_TEMPERATURE-1].show = true; }
if (GetUsedInModule(GPIO_DHT22, TasmotaGlobal.my_module.io)) { device_param[KNX_TEMPERATURE-1].show = true; }
if (GetUsedInModule(GPIO_SI7021, TasmotaGlobal.my_module.io)) { device_param[KNX_TEMPERATURE-1].show = true; }
#ifdef USE_DS18x20
if (GetUsedInModule(GPIO_DSB, TasmotaGlobal.my_module.io)) { device_param[KNX_TEMPERATURE-1].show = true; }
if (PinUsed(GPIO_DSB)) {
device_param[KNX_TEMPERATURE-1].show = true;
}
#endif
if (GetUsedInModule(GPIO_DHT11, TasmotaGlobal.my_module.io)) { device_param[KNX_HUMIDITY-1].show = true; }
if (GetUsedInModule(GPIO_DHT22, TasmotaGlobal.my_module.io)) { device_param[KNX_HUMIDITY-1].show = true; }
if (GetUsedInModule(GPIO_SI7021, TasmotaGlobal.my_module.io)) { device_param[KNX_HUMIDITY-1].show = true; }
#if defined(USE_ENERGY_SENSOR)
// Any device with a Power Monitoring