Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HA "name" consistent #1528

Closed
proddy opened this issue Dec 28, 2023 · 5 comments
Closed

HA "name" consistent #1528

proddy opened this issue Dec 28, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@proddy
Copy link
Contributor

proddy commented Dec 28, 2023

          Maybe a good time for checking the other ems-esp internal devices and make all fit in one scheme. See:

dev["name"] = Mqtt::basename();

dev["name"] = Mqtt::basename();

dev["name"] = Mqtt::basename();

dev["name"] = "EMS-ESP";

dev2["name"] = "EMS-ESP";

Originally posted by @MichaelDvP in #1517 (comment)

@arturzx
Copy link

arturzx commented Dec 30, 2023

One more thing - in shower device name is set to "EMS-ESP Shower", in other devices name is concatenated from Mqtt::basename() and name and this leads to "ems-esp ..." name and shower device is not follow this rule. Maybe all devices should have "EMS-ESP ..." names?

@MichaelDvP
Copy link
Contributor

@proddy Maybe make one subroutine and use it for all devices, something like:

void Mqtt::add_ha_dev(JsonObject & dev, const char * name) {
    auto cap_name = strdup(name);
    Helpers::CharToUpperUTF8(cap_name); // capitalize first letter
    dev["name"] = Mqtt::basename() + " " + cap_name;
    free(cap_name);
    JsonArray  ids = dev.createNestedArray("ids");
    ids.add(Mqtt::basename() + "-" + name);
}

@proddy
Copy link
Contributor Author

proddy commented Dec 30, 2023

yes, or pass the config and also create the dev nestedObject

@proddy proddy added this to the v3.6.5 milestone Jan 3, 2024
proddy added a commit that referenced this issue Jan 4, 2024
fixes #1360 (domoticz) and #1528 (HA dev name)
@proddy
Copy link
Contributor Author

proddy commented Jan 4, 2024

fixed in 3.6.5.dev-8

@proddy proddy closed this as completed Jan 4, 2024
@proddy
Copy link
Contributor Author

proddy commented Jan 6, 2024

looks like:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants