mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 21:26:43 +00:00
Change on/off states to lower case
This commit is contained in:
parent
6d8a3967d7
commit
5e25c85689
@ -846,7 +846,7 @@ void dispatch_moodlight(const char* topic, const char* payload)
|
||||
snprintf_P(
|
||||
// buffer, sizeof(buffer), PSTR("{\"state\":\"%s\",\"color\":\"#%02x%02x%02x\",\"r\":%u,\"g\":%u,\"b\":%u}"),
|
||||
buffer, sizeof(buffer), PSTR("{\"state\":\"%s\",\"color\":{\"r\":%u,\"g\":%u,\"b\":%u}}"),
|
||||
moodlight.power ? "ON" : "OFF", moodlight.r, moodlight.g, moodlight.b);
|
||||
moodlight.power ? "on" : "off", moodlight.r, moodlight.g, moodlight.b);
|
||||
dispatch_state_msg(F("moodlight"), buffer);
|
||||
}
|
||||
|
||||
@ -857,7 +857,7 @@ void dispatch_backlight(const char*, const char* payload)
|
||||
|
||||
// Return the current state
|
||||
char buffer[4];
|
||||
memcpy_P(buffer, haspDevice.get_backlight_power() ? PSTR("ON") : PSTR("OFF"), sizeof(buffer));
|
||||
memcpy_P(buffer, haspDevice.get_backlight_power() ? PSTR("on") : PSTR("off"), sizeof(buffer));
|
||||
dispatch_state_msg(F("light"), buffer);
|
||||
}
|
||||
|
||||
|
@ -195,8 +195,8 @@ void mqtt_ha_register_backlight()
|
||||
mqtt_ha_add_device_ids(doc);
|
||||
mqtt_ha_add_unique_id(doc, item);
|
||||
|
||||
// doc[F("pl_on")] = F("ON");
|
||||
// doc[F("pl_off")] = F("OFF");
|
||||
// doc[F("pl_on")] = F("on");
|
||||
// doc[F("pl_off")] = F("off");
|
||||
|
||||
char buffer[128];
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("%s/light/%s/%s/config"), discovery_prefix, haspDevice.get_hostname(),
|
||||
@ -341,8 +341,8 @@ device:
|
||||
"bri_stat_t": "~/state/dim",
|
||||
"bri_cmd_t": "~/command/dim",
|
||||
"bri_scl": 100,
|
||||
"pl_on": "ON",
|
||||
"pl_off": "OFF"
|
||||
"pl_on": "on",
|
||||
"pl_off": "off"
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ bool ethernetEvery5Seconds()
|
||||
void ethernet_get_statusupdate(char* buffer, size_t len)
|
||||
{
|
||||
snprintf_P(buffer, len, PSTR("\"eth\":\"%s\",\"link\":\"%d Mbps\",\"ip\":\"%s\","),
|
||||
eth_connected ? F("ON") : F("OFF"), ETH.linkSpeed(), ETH.localIP().toString().c_str());
|
||||
eth_connected ? F("on") : F("off"), ETH.linkSpeed(), ETH.localIP().toString().c_str());
|
||||
}
|
||||
|
||||
#endif
|
@ -106,7 +106,7 @@ void ethernet_get_statusupdate(char* buffer, size_t len)
|
||||
#endif
|
||||
|
||||
IPAddress ip = Ethernet.localIP();
|
||||
snprintf_P(buffer, len, PSTR("\"eth\":\"%s\",\"link\":%d,\"ip\":\"%d.%d.%d.%d\","), state ? F("ON") : F("OFF"), 10,
|
||||
snprintf_P(buffer, len, PSTR("\"eth\":\"%s\",\"link\":%d,\"ip\":\"%d.%d.%d.%d\","), state ? F("on") : F("off"), 10,
|
||||
ip[0], ip[1], ip[2], ip[3]);
|
||||
}
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user