mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-29 05:36:39 +00:00
Add 'MI32Option5 1' to only accept sensors if they have a BLEAlias
This commit is contained in:
parent
84620f70ea
commit
26be733269
@ -117,6 +117,7 @@ struct {
|
|||||||
uint32_t showRSSI:1;
|
uint32_t showRSSI:1;
|
||||||
uint32_t ignoreBogusBattery:1;
|
uint32_t ignoreBogusBattery:1;
|
||||||
uint32_t minimalSummary:1; // DEPRECATED!!
|
uint32_t minimalSummary:1; // DEPRECATED!!
|
||||||
|
uint32_t onlyAliased:1; // only include sensors that are aliased
|
||||||
} option;
|
} option;
|
||||||
} MI32;
|
} MI32;
|
||||||
|
|
||||||
@ -922,6 +923,13 @@ int MI32advertismentCallback(BLE_ESP32::ble_advertisment_t *pStruct)
|
|||||||
const uint8_t *addr = pStruct->addr;
|
const uint8_t *addr = pStruct->addr;
|
||||||
if(MI32isInBlockList(addr) == true) return 0;
|
if(MI32isInBlockList(addr) == true) return 0;
|
||||||
|
|
||||||
|
if (MI32.option.onlyAliased){
|
||||||
|
const char *alias = BLE_ESP32::getAlias(p->MAC);
|
||||||
|
if (!alias || !(*alias)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int svcdataCount = advertisedDevice->getServiceDataCount();
|
int svcdataCount = advertisedDevice->getServiceDataCount();
|
||||||
|
|
||||||
if (svcdataCount == 0) {
|
if (svcdataCount == 0) {
|
||||||
@ -2120,6 +2128,9 @@ void CmndMi32Option(void){
|
|||||||
case 4:{
|
case 4:{
|
||||||
MI32.option.ignoreBogusBattery = onOff;
|
MI32.option.ignoreBogusBattery = onOff;
|
||||||
} break;
|
} break;
|
||||||
|
case 5:{
|
||||||
|
MI32.option.onlyAliased = onOff;
|
||||||
|
} break;
|
||||||
}
|
}
|
||||||
ResponseCmndDone();
|
ResponseCmndDone();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user