mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 13:16:32 +00:00
Clear MI sensors when setting 'mi32Option5 1'
This commit is contained in:
parent
26be733269
commit
e14ff3e44a
@ -279,7 +279,7 @@ const char * getStateString(int state);
|
||||
//int SafeAddLog_P(uint32_t loglevel, PGM_P formatP, ...);
|
||||
|
||||
static void BLEDiag();
|
||||
const char *getAlias(uint8_t *addr);
|
||||
const char *getAlias(const uint8_t *addr);
|
||||
//void BLEAliasMqttList();
|
||||
void BLEAliasListResp();
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@ -2404,7 +2404,7 @@ static const char *noAlias = PSTR("");
|
||||
|
||||
////////////////////////////////////////////
|
||||
// use to display the alias name if required
|
||||
const char *getAlias(uint8_t *addr){
|
||||
const char *getAlias(const uint8_t *addr){
|
||||
if (!addr){
|
||||
return noAlias;
|
||||
}
|
||||
|
@ -922,11 +922,10 @@ int MI32advertismentCallback(BLE_ESP32::ble_advertisment_t *pStruct)
|
||||
int RSSI = pStruct->RSSI;
|
||||
const uint8_t *addr = pStruct->addr;
|
||||
if(MI32isInBlockList(addr) == true) return 0;
|
||||
|
||||
if (MI32.option.onlyAliased){
|
||||
const char *alias = BLE_ESP32::getAlias(p->MAC);
|
||||
const char *alias = BLE_ESP32::getAlias(addr);
|
||||
if (!alias || !(*alias)){
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2130,6 +2129,10 @@ void CmndMi32Option(void){
|
||||
} break;
|
||||
case 5:{
|
||||
MI32.option.onlyAliased = onOff;
|
||||
if (MI32.option.onlyAliased){
|
||||
// discard all sensors for a restart
|
||||
MIBLEsensors.clear();
|
||||
}
|
||||
} break;
|
||||
}
|
||||
ResponseCmndDone();
|
||||
|
Loading…
x
Reference in New Issue
Block a user