mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-03-18 23:56:32 +03:00
fix device_class #2980
This commit is contained in:
@@ -1191,7 +1191,11 @@ void Mqtt::add_ha_classes(JsonObject doc, const uint8_t device_type, const uint8
|
||||
doc[ic_ha] = F_(iconpercent); // set icon
|
||||
}
|
||||
doc[sc_ha] = sc_ha_measurement;
|
||||
doc[dc_ha] = "power_factor";
|
||||
if (entity == FL_(airHumidity)[0] || entity == FL_(remotehum)[0]) {
|
||||
doc[dc_ha] = "humidity";
|
||||
} else if (entity == FL_(battery)[0]) {
|
||||
doc[dc_ha] = "battery";
|
||||
}
|
||||
break;
|
||||
case DeviceValueUOM::SECONDS:
|
||||
case DeviceValueUOM::MINUTES:
|
||||
@@ -1544,8 +1548,8 @@ void Mqtt::add_ha_dev_section(JsonObject doc, const char * name, const bool crea
|
||||
}
|
||||
|
||||
// add mf (manufacturer/brand), mdl (model), sw (software version) and via_device
|
||||
dev_json["mf"] = brand != nullptr ? brand : "EMS-ESP";
|
||||
dev_json["mdl"] = model != nullptr ? model : "EMS-ESP";
|
||||
dev_json["mf"] = brand != nullptr ? brand : "EMS-ESP";
|
||||
dev_json["mdl"] = model != nullptr ? model : "EMS-ESP";
|
||||
dev_json["sw"] = version != nullptr ? version : "v" + std::string(EMSESP_APP_VERSION);
|
||||
dev_json["via_device"] = Mqtt::basename();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user