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

[netatmo] Correct Discovery service #12869

Merged
merged 2 commits into from
Jun 5, 2022

Conversation

clinique
Copy link
Contributor

@clinique clinique commented Jun 4, 2022

While previous behavior seemed to work, it made the weather station child of a home, being inconsistant with ModuleType description and expected API calls (e.g. calls to measurement channels were broken).

On netatmo side, this dependency exists but is partially reflected in API calls structure, most of them still being based on initial organization (before the introduction of homes for energy and security purpose).

Signed-off-by: clinique gael@lhopital.org

Signed-off-by: clinique <gael@lhopital.org>
@clinique clinique added the bug An unexpected problem or unintended behavior of an add-on label Jun 4, 2022
@clinique clinique self-assigned this Jun 4, 2022
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

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

LGTM

@lolodomo
Copy link
Contributor

lolodomo commented Jun 4, 2022

I propose @jlaur or me to test that before merging.

@jlaur
Copy link
Contributor

jlaur commented Jun 4, 2022

I propose @jlaur or me to test that before merging.

I didn't previously focus on testing discovery, but I remember you did some testing with findings and are more into the problem, so please go ahead without me. :-)

@lolodomo
Copy link
Contributor

lolodomo commented Jun 4, 2022

I have my account bridge setup in a configuration file.
Everything is then discovered when I start a discovery but my weather station and its modules are all in doubled.
One with the following UID netatmo:weather-station:compte:0123456789ab is good and when approved, the thing went ONLINE and the hierarchy is OK.
For the other one with the following UID netatmo:weather-station:compte:xxxxxxxxxxxxxxxx:0123456789ab, if I approve it, the thing remains OFFLINE because it is linked to an unknwon parent netatmo:home:compte:xxxxxxxxxxxxxxxx.

For the home, the camera and the persons, it looks good, I can approve them, the hierarchy is good and they went ONLINE. Nothing is duplicated in the inbox.

If it works for security stuff, it should work too for the weather station.

@lolodomo
Copy link
Contributor

lolodomo commented Jun 4, 2022

For the other one with the following UID netatmo:weather-station:compte:xxxxxxxxxxxxxxxx:0123456789ab, if I approve it, the thing remains OFFLINE because it is linked to an unknwon parent netatmo:home:compte:xxxxxxxxxxxxxxxx.

This is certainly the discovery through the homesdata that creates these duplicated things. Wasn't your code trying to filter them ?

Signed-off-by: clinique <gael@lhopital.org>
@lolodomo
Copy link
Contributor

lolodomo commented Jun 5, 2022

I will test again with the last version of the code but I believe it will work ;)

Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

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

Code looks good to me and change was tested with success.
Thank you.

@lolodomo lolodomo merged commit 5a2ec07 into openhab:main Jun 5, 2022
@lolodomo lolodomo added this to the 3.3 milestone Jun 5, 2022
@clinique clinique deleted the netatmo_correct_discovery branch June 6, 2022 07:35
leifbladt pushed a commit to leifbladt/openhab-addons that referenced this pull request Oct 15, 2022
* Correct Discovery service
* Enhancing weather station module handling

Signed-off-by: clinique <gael@lhopital.org>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* Correct Discovery service
* Enhancing weather station module handling

Signed-off-by: clinique <gael@lhopital.org>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
* Correct Discovery service
* Enhancing weather station module handling

Signed-off-by: clinique <gael@lhopital.org>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
* Correct Discovery service
* Enhancing weather station module handling

Signed-off-by: clinique <gael@lhopital.org>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
* Correct Discovery service
* Enhancing weather station module handling

Signed-off-by: clinique <gael@lhopital.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants