mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 22:02:17 +01:00
fix: send wifiStrength only for real signal changes
At -70 dBm the RSSI moves a dBm or two constantly, so the >1 dBm check every 1.5s sent wifiStrength to every client about 270 times an hour. That is extra traffic on an already lossy link and a state write in Home Assistant for each one. Broadcast on a channel change, or for a change of at least 3 dBm no more than every 10s. A newly connected client still gets the current value straight away. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1d1f685fce
commit
05c3d309a6
5 changed files with 44 additions and 2 deletions
|
|
@ -8,10 +8,15 @@
|
|||
|
||||
#define CONNECT_TIMEOUT 20000
|
||||
#define SSID_SCAN_INTERVAL 600000
|
||||
// A weak signal moves a dBm or two all the time, so only broadcast real
|
||||
// changes and not more often than this.
|
||||
#define RSSI_EMIT_MIN_DBM 3
|
||||
#define RSSI_EMIT_MIN_MS 10000
|
||||
class ESPNetwork {
|
||||
protected:
|
||||
unsigned long lastEmit = 0;
|
||||
unsigned long lastMDNS = 0;
|
||||
unsigned long lastRSSIEmit = 0;
|
||||
int lastRSSI = 0;
|
||||
int lastChannel = 0;
|
||||
int linkSpeed = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue