add code to query authorization data

This commit is contained in:
technyon
2022-05-06 21:53:55 +02:00
parent a76874d54a
commit b2f8d9806f
7 changed files with 80 additions and 3 deletions

View File

@@ -286,6 +286,12 @@ void Network::publishKeyTurnerState(const Nuki::KeyTurnerState& keyTurnerState,
_firstTunerStatePublish = false;
}
void Network::publishAuthorizationInfo(const uint32_t authId, const char *authName)
{
publishUInt(mqtt_topic_lock_auth_id, authId);
publishString(mqtt_topic_lock_auth_name, authName);
}
void Network::publishCommandResult(const char *resultStr)
{
publishString(mqtt_topic_lock_action_command_result, resultStr);
@@ -338,7 +344,6 @@ void Network::publishFloat(const char* topic, const float value, const uint8_t p
void Network::publishInt(const char *topic, const int value)
{
char str[30];
itoa(value, str, 10);
char path[200] = {0};
@@ -346,6 +351,15 @@ void Network::publishInt(const char *topic, const int value)
_device->mqttClient()->publish(path, str);
}
void Network::publishUInt(const char *topic, const unsigned int value)
{
char str[30];
utoa(value, str, 10);
char path[200] = {0};
buildMqttPath(topic, path);
_device->mqttClient()->publish(path, str);
}
void Network::publishBool(const char *topic, const bool value)
{
char str[2] = {0};