publish presence via mqtt

This commit is contained in:
technyon
2022-04-05 22:35:20 +02:00
parent 4616b5e020
commit 9a13893c89
6 changed files with 79 additions and 10 deletions

View File

@@ -148,6 +148,12 @@ void Network::update()
}
}
if(_presenceCsv != nullptr)
{
publishString(mqtt_topic_presence, _presenceCsv);
_presenceCsv = nullptr;
}
_mqttClient.loop();
vTaskDelay( 100 / portTICK_PERIOD_MS);
@@ -240,6 +246,11 @@ void Network::publishBatteryReport(const Nuki::BatteryReport& batteryReport)
publishInt(mqtt_topic_battery_lock_distance, batteryReport.lockDistance); // degrees
}
void Network::publishPresenceDetection(char *csv)
{
_presenceCsv = csv;
}
void Network::setLockActionReceived(void (*lockActionReceivedCallback)(const char *))
{
_lockActionReceivedCallback = lockActionReceivedCallback;