feat: add a button gesture to return to pairing mode
A light that has a network only ever rejoins that one, so there was no way to re-pair it or move it to another coordinator without reflashing. Holding the encoder button for 10 seconds now makes the light flash green twice, forget its Zigbee network (saved to flash) and restart, after which it looks for a network with an open pairing window, in ZHA with Add device. The coordinator is not told, so Home Assistant keeps the device and recognises it by its IEEE address when it joins again. While the light is looking for a network the on-board LED blinks fast instead of once a second, so a waiting pairing window can be seen to be picked up, and the change between joined and searching is logged. The README documents the gesture and how pairing works, and notes that the extended PAN ID is broadcast by the network and is not a secret. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
90af6197c6
commit
575cd8896f
6 files changed
+136
-12
No files matched your search
@@ -18,9 +18,18 @@ pub const STEPS_PER_BRIGHTNESS_UNIT: i32 = 1;
|
||||
/// Hold time that separates a click from a long press.
|
||||
pub const LONG_PRESS_MS: u64 = 600;
|
||||
|
||||
/// Hold time that makes the light forget its Zigbee network and go back to
|
||||
/// pairing mode.
|
||||
pub const RESET_HOLD_MS: u64 = 10_000;
|
||||
|
||||
/// Contact settle time for the encoder push button.
|
||||
pub const DEBOUNCE_MS: u64 = 15;
|
||||
|
||||
/// Heartbeat blink: a brief pulse, repeated once a second.
|
||||
pub const HEARTBEAT_ON_MS: u64 = 50;
|
||||
pub const HEARTBEAT_PERIOD_MS: u64 = 1000;
|
||||
|
||||
/// The faster blink that shows the light is looking for a Zigbee network to
|
||||
/// join, so a pairing window can be seen to be waiting for it.
|
||||
pub const SEARCHING_ON_MS: u64 = 100;
|
||||
pub const SEARCHING_PERIOD_MS: u64 = 300;
|
||||
Reference in new issue
Block a user