Change on/off states to lower case

This commit is contained in:
fvanroie 2021-02-28 02:16:20 +01:00
parent 6d8a3967d7
commit 5e25c85689
4 changed files with 8 additions and 8 deletions

View File

@ -846,7 +846,7 @@ void dispatch_moodlight(const char* topic, const char* payload)
snprintf_P( 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\":\"#%02x%02x%02x\",\"r\":%u,\"g\":%u,\"b\":%u}"),
buffer, sizeof(buffer), PSTR("{\"state\":\"%s\",\"color\":{\"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); dispatch_state_msg(F("moodlight"), buffer);
} }
@ -857,7 +857,7 @@ void dispatch_backlight(const char*, const char* payload)
// Return the current state // Return the current state
char buffer[4]; 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); dispatch_state_msg(F("light"), buffer);
} }

View File

@ -195,8 +195,8 @@ void mqtt_ha_register_backlight()
mqtt_ha_add_device_ids(doc); mqtt_ha_add_device_ids(doc);
mqtt_ha_add_unique_id(doc, item); mqtt_ha_add_unique_id(doc, item);
// doc[F("pl_on")] = F("ON"); // doc[F("pl_on")] = F("on");
// doc[F("pl_off")] = F("OFF"); // doc[F("pl_off")] = F("off");
char buffer[128]; char buffer[128];
snprintf_P(buffer, sizeof(buffer), PSTR("%s/light/%s/%s/config"), discovery_prefix, haspDevice.get_hostname(), 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_stat_t": "~/state/dim",
"bri_cmd_t": "~/command/dim", "bri_cmd_t": "~/command/dim",
"bri_scl": 100, "bri_scl": 100,
"pl_on": "ON", "pl_on": "on",
"pl_off": "OFF" "pl_off": "off"
} }
{ {

View File

@ -67,7 +67,7 @@ bool ethernetEvery5Seconds()
void ethernet_get_statusupdate(char* buffer, size_t len) void ethernet_get_statusupdate(char* buffer, size_t len)
{ {
snprintf_P(buffer, len, PSTR("\"eth\":\"%s\",\"link\":\"%d Mbps\",\"ip\":\"%s\","), 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 #endif

View File

@ -106,7 +106,7 @@ void ethernet_get_statusupdate(char* buffer, size_t len)
#endif #endif
IPAddress ip = Ethernet.localIP(); 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]); ip[0], ip[1], ip[2], ip[3]);
} }
#endif #endif