Stop write queue when BLE is not connected to avoid loosing commands
- Set max retry count to 10 since BLE loop will set channel to disconnected after 5 retries (or known unrecoverable errors)
This commit is contained in:
parent
e8ab13aed3
commit
4d5a4ddbe3
5 changed files with 99 additions and 81 deletions
|
|
@ -41,10 +41,10 @@ class DeviceRegistry {
|
|||
);
|
||||
|
||||
if (added.roomId) {
|
||||
this.deviceIdsByRoom[added.roomId] = [
|
||||
...(this.deviceIdsByRoom[added.roomId] || []),
|
||||
added.id,
|
||||
];
|
||||
const room = this.deviceIdsByRoom[added.roomId] || [];
|
||||
if (!room.includes(added.roomId)) {
|
||||
this.deviceIdsByRoom[added.roomId] = [...room, added.roomId];
|
||||
}
|
||||
logger.verbose(
|
||||
`Added to room #${added.roomId}: ${JSON.stringify(this.deviceIdsByRoom[added.roomId])}`,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue