Update potentially wrong client_ids (#93)

This commit is contained in:
Marius Muja 2023-11-05 16:13:32 -08:00 committed by GitHub
parent 8317f18b86
commit 66ba19e69e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,15 @@ namespace ratgdo {
value = 0;
}
}
else {
if (this->number_type_ == RATGDO_CLIENT_ID) {
uint32_t int_value = static_cast<uint32_t>(value);
if ((int_value & 0xFFF) != 0x539) {
value = ((random_uint32() + 1) % 0xFFFF) << 12 | 0x539;
this->pref_.save(&value);
}
}
}
this->publish_state(value);
this->control(value);