fix: only let wifiStrength broadcasts move the RSSI baseline

The emit to a newly connected client also stored the RSSI and time, which
restarted the 10s hold-off and hid a real change from the clients already
connected.  The baseline moves into RssiBroadcast, which ignores
per-client emits, with unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-12 18:34:45 +02:00
parent c4472ba8e8
commit e47381b19e
5 changed files with 72 additions and 11 deletions

View file

@ -1,5 +1,6 @@
#include <Arduino.h>
#include <WiFi.h>
#include "Utils.h"
#ifndef ESPNetwork_h
#define ESPNetwork_h
@ -21,9 +22,7 @@ class ESPNetwork {
protected:
unsigned long lastEmit = 0;
unsigned long lastMDNS = 0;
unsigned long lastRSSIEmit = 0;
int lastRSSI = 0;
int lastChannel = 0;
RssiBroadcast rssiBroadcast;
int linkSpeed = 0;
bool _connecting = false;
public: