|
|
- /*
-
- DOMOTICZ MODULE
-
- Copyright (C) 2016-2017 by Xose Pérez <xose dot perez at gmail dot com>
-
- */
-
- #if ENABLE_DOMOTICZ
-
- template<typename T> void domoticzSend(const char * key, T nvalue, const char * svalue) {
- unsigned int idx = getSetting(key).toInt();
- if (idx > 0) {
- char payload[128];
- snprintf(payload, 128, "{\"idx\": %d, \"nvalue\": %s, \"svalue\": \"%s\"}", idx, String(nvalue).c_str(), svalue);
- mqttSendRaw(getSetting("dczTopicIn", DOMOTICZ_IN_TOPIC).c_str(), payload);
- }
- }
-
- template<typename T> void domoticzSend(const char * key, T nvalue) {
- domoticzSend(key, nvalue, "");
- }
-
- #endif
|