make rssi publish interval configurable
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user