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

getData() based on managementPointType #155

Open
JeroenVdb opened this issue Aug 11, 2024 · 1 comment · May be fixed by #156
Open

getData() based on managementPointType #155

JeroenVdb opened this issue Aug 11, 2024 · 1 comment · May be fixed by #156

Comments

@JeroenVdb
Copy link
Contributor

JeroenVdb commented Aug 11, 2024

Current getData() works based on embeddedId. Until now I assumed the embeddedId was always one of "climateControl" or "climateControlMainZone". Issue JeroenVdb/homebridge-daikin-cloud#78 points out that the embeddedId can also have other values.

This is also confirmed by the Daikin API documentation: https://b6181f2edaca.eu.portal.konghq.com/docs/b0dffcaa-7b51-428a-bdff-a7c8a64195c0/general_concepts#doc-heading-management-point-overview

A management point bundles a part of the functionality of a Daikin unit. For example, a Daikin unit can have both domestic hot water and climate control functionality. Network gateway functionality is also exposed as a management point.
Examples:1st floor climate control, domestic hot water tank, living room heat pump indoor unit.
In the ONECTA Cloud, a limited number of different management point types, based on the different high-level functionalities, are supported. An overview is given here.

The examples given by Daikin all have different embeddedIds.

I would need to be able to get a management point id by it's type.
Either by having a separate method that gets all managementPoints for a managementPointType.

getManagementPointByType(managementPointType: string) { ... }
// OR
getEmbeddedIdsByManagementPointType(managementPointType: string) { ... }

Or have a second getDataByManagementType() method that chains getData() like

getDataByManagementType(managementPointType: string, dataPoint: any, dataPointPath: any) {
        const embeddedId = ...
        return this.getData(embeddedId, dataPoint, dataPointPath);
    }

One unknown: is it possible that we have multiple management points of the same type? I haven't seen it, nor is it stated in the docs. But I assume that a type can have multiple occurrences. If you would go that way, the first approach would be better I think. In that case applications would first find the embeddedIds they need and then do the getData calls for them.

Let me know what you think, if you want I can do a PR for this.

@Apollon77
Copy link
Owner

Yes makes sense, if the Types are basically known then we could use an Enum for them?

@JeroenVdb JeroenVdb linked a pull request Aug 11, 2024 that will close this issue
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 a pull request may close this issue.

2 participants