Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DISC] Whitelist immediate change #2133

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/use/ble.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ A white list is a list of MAC addresses permitted to be published by OMG
to set white list
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"white-list":["01:23:14:55:16:15","4C:65:77:88:9C:79","4C:65:A6:66:3C:79"]}'`

Note: if you want to filter (white or black list) on BLE sensors that are auto discovered, you need to wait for the discovery before applying the white or black list, or temporarily disable it:

to temporarily disable white/black list
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"ignoreWBlist":true}'`

Expand Down
8 changes: 7 additions & 1 deletion main/ZgatewayBT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,16 @@ void createOrUpdateDevice(const char* mac, uint8_t flags, int model, int mac_typ
device->connect = true;
}

if (model != UNKWNON_MODEL) {
if (model != UNKWNON_MODEL && device->sensorModel_id == UNKWNON_MODEL) {
newDevices++;
device->isDisc = false;
device->sensorModel_id = model;
}

// If a device has been added to the white-list, flag it so it can be auto-detected
if (!device->isWhtL && flags & device_flags_isWhiteL) {
newDevices++;
}
if (flags & device_flags_isWhiteL || flags & device_flags_isBlackL) {
device->isWhtL = flags & device_flags_isWhiteL;
device->isBlkL = flags & device_flags_isBlackL;
Expand Down
Loading