cgtobi / netatmo_custom

This repo is a custom component from the beta version of the official HA netatmo component
MIT License
13 stars 6 forks source link

Missing coordinates when retrieving public weather data. #15

Open vlebourl opened 2 years ago

vlebourl commented 2 years ago

https://github.com/cgtobi/netatmo_custom/blob/a01e7190a2bafbbd953918a014e0576dfb20601e/custom_components/netatmo/pyatmo/account.py#L141

params should be set with the area coordinates. This seems to work:

    async def async_update_public_weather(self, area_id: str) -> None:
        """Retrieve status data from /getpublicdata"""
        params = {
            "lat_ne": self.public_weather_areas[area_id].location.lat_ne,
            "lon_ne": self.public_weather_areas[area_id].location.lon_ne,
            "lat_sw": self.public_weather_areas[area_id].location.lat_sw,
            "lon_sw": self.public_weather_areas[area_id].location.lon_sw,
            "filtering": ("true" if self.public_weather_areas[area_id].filtering else "false"),
        }
        await self._async_update_data(_GETPUBLIC_DATA, tag="body", params=params, area_id=area_id)
vlebourl commented 2 years ago

With this fix, I don't get wind strength and gust strength anymore. Is that expected? Cheers.

cgtobi commented 2 years ago

No, that is a bug. Thanks for the fix. I'll look into it.

cgtobi commented 2 years ago

Gust strength is disabled by default but can be enabled manually.