Skip to content
This repository was archived by the owner on Dec 4, 2020. It is now read-only.

Additional publicdata measures#15

Merged
jabesq merged 2 commits intojabesq:masterfrom
GP8x:additional-publicdata-measures
Sep 16, 2018
Merged

Additional publicdata measures#15
jabesq merged 2 commits intojabesq:masterfrom
GP8x:additional-publicdata-measures

Conversation

@GP8x
Copy link
Copy Markdown

@GP8x GP8x commented Sep 7, 2018

Extended the GetPublicData API to support the following measures in addition to rain:

  • temperature
  • pressure
  • humidity
  • wind_strength
  • wind_angle
  • wind_timeutc
  • gust_strength
  • gust_angle

This PR renames all the API methods in this file to indicate the measure they are retrieving although have retained the original getLive(), get24h(), get60min() and getTimeforMeasure() for backwards compatibility.

This PR also splits the measures into two distinct types "station" and "accessory" - station indicating they come from the original Netatmo weather station and accessory to indicate they come from either the rain or anemometer units. This is important as the data returned in the GetPublicData API is different. e.g:

{
    'res': {
        '1536357836': [12.7, 63]
    },
    'type': ['temperature', 'humidity']
}

compared to:

{
    'rain_60min': 0,
    'rain_24h': 0.101,
    'rain_live': 0,
    'rain_timeutc': 1536357829
}

Additionally, the wrapper now includes methods to get a single average value for each measure to ease end users who just want a simple way to get a single value for an area. The only exception to this is the wind/gust angle measures - the data is not clean enough for an average to be useful.

Bumped to version 1.2 to indicate the additions but no API changes.

p.s. HomeAssistant fans - The whole purpose of this PR is so that I can extend the support of the new Netatmo Public Sensor :)

@jabesq jabesq merged commit c6be4fe into jabesq:master Sep 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants