Browse Source

Quote unit_of_measurement is homeassistant module as it might have invalid chars (#1227)

ota
Xose Pérez 6 years ago
parent
commit
f01f2454cc
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      code/espurna/homeassistant.ino

+ 1
- 1
code/espurna/homeassistant.ino View File

@ -36,7 +36,7 @@ void _haSendMagnitude(unsigned char i, JsonObject& config) {
config["name"] = _haFixName(getSetting("hostname") + String(" ") + magnitudeTopic(type)); config["name"] = _haFixName(getSetting("hostname") + String(" ") + magnitudeTopic(type));
config.set("platform", "mqtt"); config.set("platform", "mqtt");
config["state_topic"] = mqttTopic(magnitudeTopicIndex(i).c_str(), false); config["state_topic"] = mqttTopic(magnitudeTopicIndex(i).c_str(), false);
config["unit_of_measurement"] = magnitudeUnits(type);
config["unit_of_measurement"] = "\"" + magnitudeUnits(type) + "\"";
} }


Loading…
Cancel
Save