remove remaining presence detection code
This commit is contained in:
@@ -425,6 +425,7 @@ bool NukiNetwork::update()
|
|||||||
|
|
||||||
_lastConnectedTs = ts;
|
_lastConnectedTs = ts;
|
||||||
|
|
||||||
|
#if PRESENCE_DETECTION_ENABLED
|
||||||
if(_presenceDetection != nullptr && (_lastPresenceTs == 0 || (ts - _lastPresenceTs) > 3000))
|
if(_presenceDetection != nullptr && (_lastPresenceTs == 0 || (ts - _lastPresenceTs) > 3000))
|
||||||
{
|
{
|
||||||
char* presenceCsv = _presenceDetection->generateCsv();
|
char* presenceCsv = _presenceDetection->generateCsv();
|
||||||
@@ -437,6 +438,7 @@ bool NukiNetwork::update()
|
|||||||
|
|
||||||
_lastPresenceTs = ts;
|
_lastPresenceTs = ts;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(_device->signalStrength() != 127 && _rssiPublishInterval > 0 && ts - _lastRssiTs > _rssiPublishInterval)
|
if(_device->signalStrength() != 127 && _rssiPublishInterval > 0 && ts - _lastRssiTs > _rssiPublishInterval)
|
||||||
{
|
{
|
||||||
@@ -760,11 +762,13 @@ void NukiNetwork::gpioActionCallback(const GpioAction &action, const int &pin)
|
|||||||
_gpioTs[pin] = millis();
|
_gpioTs[pin] = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PRESENCE_DETECTION_ENABLED
|
||||||
void NukiNetwork::setMqttPresencePath(char *path)
|
void NukiNetwork::setMqttPresencePath(char *path)
|
||||||
{
|
{
|
||||||
memset(_mqttPresencePrefix, 0, sizeof(_mqttPresencePrefix));
|
memset(_mqttPresencePrefix, 0, sizeof(_mqttPresencePrefix));
|
||||||
strcpy(_mqttPresencePrefix, path);
|
strcpy(_mqttPresencePrefix, path);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void NukiNetwork::disableAutoRestarts()
|
void NukiNetwork::disableAutoRestarts()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,9 @@ public:
|
|||||||
explicit NukiNetwork(Preferences* preferences, PresenceDetection* presenceDetection, Gpio* gpio, const String& maintenancePathPrefix, char* buffer, size_t bufferSize);
|
explicit NukiNetwork(Preferences* preferences, PresenceDetection* presenceDetection, Gpio* gpio, const String& maintenancePathPrefix, char* buffer, size_t bufferSize);
|
||||||
|
|
||||||
void registerMqttReceiver(MqttReceiver* receiver);
|
void registerMqttReceiver(MqttReceiver* receiver);
|
||||||
|
#if PRESENCE_DETECTION_ENABLED
|
||||||
void setMqttPresencePath(char* path);
|
void setMqttPresencePath(char* path);
|
||||||
|
#endif
|
||||||
void disableAutoRestarts(); // disable on OTA start
|
void disableAutoRestarts(); // disable on OTA start
|
||||||
void disableMqtt();
|
void disableMqtt();
|
||||||
|
|
||||||
@@ -175,7 +177,9 @@ private:
|
|||||||
unsigned long _lastConnectedTs = 0;
|
unsigned long _lastConnectedTs = 0;
|
||||||
unsigned long _lastMaintenanceTs = 0;
|
unsigned long _lastMaintenanceTs = 0;
|
||||||
unsigned long _lastUpdateCheckTs = 0;
|
unsigned long _lastUpdateCheckTs = 0;
|
||||||
|
#if PRESENCE_DETECTION_ENABLED
|
||||||
unsigned long _lastPresenceTs = 0;
|
unsigned long _lastPresenceTs = 0;
|
||||||
|
#endif
|
||||||
unsigned long _lastRssiTs = 0;
|
unsigned long _lastRssiTs = 0;
|
||||||
bool _mqttEnabled = true;
|
bool _mqttEnabled = true;
|
||||||
long _rssiPublishInterval = 0;
|
long _rssiPublishInterval = 0;
|
||||||
|
|||||||
@@ -55,7 +55,9 @@ void NukiNetworkLock::initialize()
|
|||||||
_preferences->putString(preference_mqtt_lock_path, _mqttPath);
|
_preferences->putString(preference_mqtt_lock_path, _mqttPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PRESENCE_DETECTION_ENABLED
|
||||||
_network->setMqttPresencePath(_mqttPath);
|
_network->setMqttPresencePath(_mqttPath);
|
||||||
|
#endif
|
||||||
|
|
||||||
_haEnabled = _preferences->getString(preference_mqtt_hass_discovery) != "";
|
_haEnabled = _preferences->getString(preference_mqtt_hass_discovery) != "";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user