mirror of https://github.com/arendst/Tasmota.git
Add function KeyTopicActive(key)
Add function KeyTopicActive(key)
This commit is contained in:
parent
b0399a550e
commit
057ff37263
|
@ -719,6 +719,16 @@ bool ButtonTopicActive(void)
|
|||
return ((strlen(key_topic) != 0) && strcmp(key_topic, "0"));
|
||||
}
|
||||
|
||||
bool KeyTopicActive(uint32_t key)
|
||||
{
|
||||
// key = 0 - Button topic
|
||||
// key = 1 - Switch topic
|
||||
key &= 1;
|
||||
char key_topic[TOPSZ];
|
||||
Format(key_topic, SettingsText(SET_MQTT_BUTTON_TOPIC + key), sizeof(key_topic));
|
||||
return ((strlen(key_topic) != 0) && strcmp(key_topic, "0"));
|
||||
}
|
||||
|
||||
/*********************************************************************************************\
|
||||
* Commands
|
||||
\*********************************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue