openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.59k forks source link

[netatmo] Requesting favorite stations only when needed #12769

Closed lolodomo closed 2 years ago

lolodomo commented 2 years ago

I have not enabled favorite stations: image

But the binding requests favorite data anyway:

15:04:30.993 [TRACE] [tmo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/getstationsdata?device_id=xxx&get_favorites=true

This is probably triggered at this line with the second parameter set to true: https://github.com/openhab/openhab-addons/blob/main/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/api/WeatherApi.java#L66

It could (should) be optimized to use false when getStationData is called for your local weather station.

@clinique : WDYT ?

lolodomo commented 2 years ago

I think I know how to enhance that, I will submit a PR after testing.

clinique commented 2 years ago

You're welcome, I've got many plates on the fire :)

jlaur commented 2 years ago

@lolodomo - can you remind me how to access binding configuration from MainUI when installed as JAR?

lolodomo commented 2 years ago

You click "+" to add new thing and then in the "Choose binding" you have a special icon on "Netatmo Binding" to access its configuration.

PS: look at my other issue, any change is taken into acocunt only after a restart.