mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
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"));
|
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
|
* Commands
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user