make rssi publish interval configurable

This commit is contained in:
technyon
2023-01-22 19:42:12 +01:00
parent d754f6319f
commit 5512a517c6
9 changed files with 26 additions and 9 deletions

View File

@@ -50,6 +50,7 @@ void NukiWrapper::initialize(const bool& firstStart)
_hassEnabled = _preferences->getString(preference_mqtt_hass_discovery) != "";
_nrOfRetries = _preferences->getInt(preference_command_nr_of_retries);
_retryDelay = _preferences->getInt(preference_command_retry_delay);
_rssiPublishInterval = _preferences->getInt(preference_rssi_publish_interval);
if(firstStart)
{
@@ -158,9 +159,9 @@ void NukiWrapper::update()
setupHASS();
}
}
if(_nextRssiTs == 0 || ts > _nextRssiTs)
if(_rssiPublishInterval > 0 && (_nextRssiTs == 0 || ts > _nextRssiTs))
{
_nextRssiTs = ts + 3000;
_nextRssiTs = ts + _rssiPublishInterval;
int rssi = _nukiLock.getRssi();
if(rssi != _lastRssi)