Skip to content

Commit aab069d

Browse files
author
xlyric
committed
ajout alerte HA
1 parent cf8da5d commit aab069d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/config/enums.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,9 @@ struct HA {
681681
public:void discovery() {
682682
String dev_switch= "";
683683

684-
if (dev_cla =="switch" ) {
684+
if (stat_cla == nullptr) { //rien faire
685+
}
686+
else if (dev_cla =="switch" ) {
685687
dev_switch = R"(
686688
"pl_on": "{ \")" + name + R"(\" : \"1\" }",
687689
"pl_off": "{ \")" + name + R"(\" : \"0\" }",
@@ -694,6 +696,7 @@ struct HA {
694696
"unit_of_meas": ")" + unit_of_meas + R"(",
695697
"stat_cla": ")" + stat_cla + R"(",
696698
)";
699+
697700
}
698701

699702
IPaddress = WiFi.localIP() ;

src/functions/homeassistant.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@
9999

100100
// création des binary_sensor
101101
device_dimmer_alarm_temp.Set_name("Surchauffe");
102-
device_dimmer_alarm_temp.Set_dev_cla("problem");
103-
102+
device_dimmer_alarm_temp.Set_dev_cla("enum");
103+
device_dimmer_alarm_temp.Set_icon("mdi:alert");
104+
104105
switch_relay1.Set_name("Relay1");
105106
switch_relay1.Set_dev_cla("switch");
106107

0 commit comments

Comments
 (0)