set retain flag
This commit is contained in:
@@ -455,7 +455,7 @@ void NetworkLock::publishFloat(const char* topic, const float value, const uint8
|
|||||||
dtostrf(value, 0, precision, str);
|
dtostrf(value, 0, precision, str);
|
||||||
char path[200] = {0};
|
char path[200] = {0};
|
||||||
buildMqttPath(topic, path);
|
buildMqttPath(topic, path);
|
||||||
_device->mqttClient()->publish(path, str);
|
_device->mqttClient()->publish(path, str, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkLock::publishInt(const char *topic, const int value)
|
void NetworkLock::publishInt(const char *topic, const int value)
|
||||||
@@ -464,7 +464,7 @@ void NetworkLock::publishInt(const char *topic, const int value)
|
|||||||
itoa(value, str, 10);
|
itoa(value, str, 10);
|
||||||
char path[200] = {0};
|
char path[200] = {0};
|
||||||
buildMqttPath(topic, path);
|
buildMqttPath(topic, path);
|
||||||
_device->mqttClient()->publish(path, str);
|
_device->mqttClient()->publish(path, str, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkLock::publishUInt(const char *topic, const unsigned int value)
|
void NetworkLock::publishUInt(const char *topic, const unsigned int value)
|
||||||
@@ -473,7 +473,7 @@ void NetworkLock::publishUInt(const char *topic, const unsigned int value)
|
|||||||
utoa(value, str, 10);
|
utoa(value, str, 10);
|
||||||
char path[200] = {0};
|
char path[200] = {0};
|
||||||
buildMqttPath(topic, path);
|
buildMqttPath(topic, path);
|
||||||
_device->mqttClient()->publish(path, str);
|
_device->mqttClient()->publish(path, str, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkLock::publishBool(const char *topic, const bool value)
|
void NetworkLock::publishBool(const char *topic, const bool value)
|
||||||
@@ -482,14 +482,14 @@ void NetworkLock::publishBool(const char *topic, const bool value)
|
|||||||
str[0] = value ? '1' : '0';
|
str[0] = value ? '1' : '0';
|
||||||
char path[200] = {0};
|
char path[200] = {0};
|
||||||
buildMqttPath(topic, path);
|
buildMqttPath(topic, path);
|
||||||
_device->mqttClient()->publish(path, str);
|
_device->mqttClient()->publish(path, str, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NetworkLock::publishString(const char *topic, const char *value)
|
bool NetworkLock::publishString(const char *topic, const char *value)
|
||||||
{
|
{
|
||||||
char path[200] = {0};
|
char path[200] = {0};
|
||||||
buildMqttPath(topic, path);
|
buildMqttPath(topic, path);
|
||||||
return _device->mqttClient()->publish(path, value);
|
return _device->mqttClient()->publish(path, value, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NetworkLock::isMqttConnected()
|
bool NetworkLock::isMqttConnected()
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ void NetworkOpener::publishFloat(const char* topic, const float value, const uin
|
|||||||
dtostrf(value, 0, precision, str);
|
dtostrf(value, 0, precision, str);
|
||||||
char path[200] = {0};
|
char path[200] = {0};
|
||||||
buildMqttPath(topic, path);
|
buildMqttPath(topic, path);
|
||||||
_network->device()->mqttClient()->publish(path, str);
|
_network->device()->mqttClient()->publish(path, str, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkOpener::publishInt(const char *topic, const int value)
|
void NetworkOpener::publishInt(const char *topic, const int value)
|
||||||
@@ -201,7 +201,7 @@ void NetworkOpener::publishInt(const char *topic, const int value)
|
|||||||
itoa(value, str, 10);
|
itoa(value, str, 10);
|
||||||
char path[200] = {0};
|
char path[200] = {0};
|
||||||
buildMqttPath(topic, path);
|
buildMqttPath(topic, path);
|
||||||
_network->device()->mqttClient()->publish(path, str);
|
_network->device()->mqttClient()->publish(path, str, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkOpener::publishUInt(const char *topic, const unsigned int value)
|
void NetworkOpener::publishUInt(const char *topic, const unsigned int value)
|
||||||
@@ -210,7 +210,7 @@ void NetworkOpener::publishUInt(const char *topic, const unsigned int value)
|
|||||||
utoa(value, str, 10);
|
utoa(value, str, 10);
|
||||||
char path[200] = {0};
|
char path[200] = {0};
|
||||||
buildMqttPath(topic, path);
|
buildMqttPath(topic, path);
|
||||||
_network->device()->mqttClient()->publish(path, str);
|
_network->device()->mqttClient()->publish(path, str, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkOpener::publishBool(const char *topic, const bool value)
|
void NetworkOpener::publishBool(const char *topic, const bool value)
|
||||||
@@ -219,14 +219,14 @@ void NetworkOpener::publishBool(const char *topic, const bool value)
|
|||||||
str[0] = value ? '1' : '0';
|
str[0] = value ? '1' : '0';
|
||||||
char path[200] = {0};
|
char path[200] = {0};
|
||||||
buildMqttPath(topic, path);
|
buildMqttPath(topic, path);
|
||||||
_network->device()->mqttClient()->publish(path, str);
|
_network->device()->mqttClient()->publish(path, str, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkOpener::publishString(const char *topic, const char *value)
|
void NetworkOpener::publishString(const char *topic, const char *value)
|
||||||
{
|
{
|
||||||
char path[200] = {0};
|
char path[200] = {0};
|
||||||
buildMqttPath(topic, path);
|
buildMqttPath(topic, path);
|
||||||
_network->device()->mqttClient()->publish(path, value);
|
_network->device()->mqttClient()->publish(path, value, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkOpener::buildMqttPath(const char* path, char* outPath)
|
void NetworkOpener::buildMqttPath(const char* path, char* outPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user