Shorten "friendly names" in Home Assistant

see #555
This commit is contained in:
pswid
2022-06-21 20:28:22 +02:00
parent 1fab47acd5
commit 1c48d12167
3 changed files with 28 additions and 10 deletions

View File

@@ -497,7 +497,10 @@ void DallasSensor::publish_values(const bool force) {
snprintf(str, sizeof(str), "{{value_json['%s'].temp}}", sensor.id().c_str());
config["val_tpl"] = str;
snprintf(str, sizeof(str), "Temperature Sensor %s", sensor.name().c_str());
snprintf(str, sizeof(str), "temperature_sensor_%s", sensor.name().c_str());
config["object_id"] = str;
snprintf(str, sizeof(str), "%s", sensor.name().c_str());
config["name"] = str;
snprintf(str, sizeof(str), "dallasensor_%s", sensor.id().c_str());