[LPM] Add capability to deactivate the function at build time (#1449)

To enable boards with the constant power supply to don't build this function.
Change the default behavior for the mode not to be built by default.
Only the boards with batteries are keeping it
This commit is contained in:
Florian authored and GitHub committed 2023-02-10 17:07:28 -06:00
1 parent 7c0fafd48e
commit 5bcf214d68
4 files changed
+28 -14

No files matched your search

+2
View File
@@ -1029,6 +1029,7 @@ void pubMqttDiscovery() {
stateClassNone, //State Class
"false", "true" //state_off, state_on
);
# if DEFAULT_LOW_POWER_MODE != -1
createDiscovery("switch", //set Type
subjectSYStoMQTT, "SYS: Low Power Mode command", (char*)getUniqueId("lowpowermode", "").c_str(), //set state_topic,name,uniqueId
"", "", "{{ value_json.lowpowermode | bool }}", //set availability_topic,device_class,value_template,
@@ -1039,6 +1040,7 @@ void pubMqttDiscovery() {
stateClassNone, //State Class
"false", "true" //state_off, state_on
);
# endif
# endif
# endif
}