Skip to content

Commit

Permalink
Reduced "signal" MQTT messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aly-fly committed Sep 9, 2024
1 parent d1cef56 commit 9bbfb00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion EleksTubeHAX_pio/src/Mqtt_client_ips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ void MqttReportPowerState() {
void MqttReportWiFiSignal() {
char signal[5];
int SignalLevel = WiFi.RSSI();
if (SignalLevel != LastSentSignalLevel) {
// ignore deviations smaller than 3 dBm
if (abs(SignalLevel - LastSentSignalLevel) > 2) {
sprintf(signal, "%d", SignalLevel);
sendToBroker("report/signal", signal); // Reports the signal strength
LastSentSignalLevel = SignalLevel;
Expand Down

0 comments on commit 9bbfb00

Please sign in to comment.