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

support entities api endpoint for multiple devices of same type #2373

Merged
merged 20 commits into from
Jan 26, 2025

Conversation

proddy
Copy link
Contributor

@proddy proddy commented Jan 25, 2025

when there are multiple thermostats with different hc numbers, the api/thermostat/hc*/entities would always only show hc1.
Now api/thermostat/hc2/entities works

@proddy proddy requested a review from MichaelDvP January 25, 2025 12:33
Copy link
Contributor

@MichaelDvP MichaelDvP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the entities command i think it's better always loop all thermostats, annd add the circuits to root:

    bool found_device = false;
    for (const auto & emsdevice : emsdevices) {
        if (emsdevice->device_type() == devicetype) {
            found_device = true;
            emsdevice->get_value_info(root, cmd, id);
        }
    }
    // if the EMS device was valid, but the cmd not found exit. it will be handled upstream.
    if (found_device) {
        return root.size() > 0;
    }

@proddy proddy merged commit 0ab7eb4 into emsesp:dev Jan 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants