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

Add additional Netatmo public data sensors #16671

Merged
merged 1 commit into from Sep 25, 2018

Conversation

Projects
None yet
5 participants
@GP8x
Contributor

GP8x commented Sep 17, 2018

Description:

I updated the pyatmo library to expose additional conditions from the Netatmo GetPublicData API in this PR: jabesq/netatmo-api-python#15

This PR extends the HomeAssistant Netatmo Public sensor to monitor the following conditions:

  • temperature
  • pressure
  • humidity
  • rain
  • windstrength
  • guststrength

In order to change from a single value sensor to multi-value I made a breaking change to the configuration to add in a monitored_conditions list for each "area". At the same time I also changed the current optional type configuration property to mode as type to me didn't accurately describe the function the value performs (switching between avg and max sensor data processing). I realize breaking configuration changes are generally not a good thing but believe the above approach is more extensible for the future and better aligns the sensor configuration with other multi-condition sensors (e.g. Yahoo Weather).

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#6303

Example entry for configuration.yaml (if applicable):

sensor:
  - platform: netatmo_public
    areas:
      - lat_ne: 40.719
        lon_ne: -73.735
        lat_sw: 40.552
        lon_sw: -74.105
        monitored_conditions:
          - temperature
          - pressure
          - humidity
          - rain
          - windstrength
          - guststrength

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
@Danielhiversen

Great 🎉

LON_NE=self.lon_ne,
LAT_SW=self.lat_sw,
LON_SW=self.lon_sw,
filtering=True)

This comment has been minimized.

@Danielhiversen

Danielhiversen Sep 19, 2018

Member

What is filtering?

This comment has been minimized.

@GP8x

GP8x Sep 19, 2018

Contributor

Filtering makes the API response exclude abnormal sensor readings. For example if someone installs an outside sensor indoors.

@Danielhiversen

This comment has been minimized.

Member

Danielhiversen commented Sep 24, 2018

@colinfrei Any comments?

@Danielhiversen Danielhiversen merged commit 03bce84 into home-assistant:dev Sep 25, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.06%) to 93.63%
Details

@wafflebot wafflebot bot removed the in progress label Sep 25, 2018

if self.netatmo_data.data is None:
_LOGGER.warning("No data found for %s", self._name)
self._state = STATE_UNKNOWN

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Sep 25, 2018

Member

We should use None to represent unknown state.

@Danielhiversen Danielhiversen referenced this pull request Sep 25, 2018

Merged

change unknown to None in Netatmo public #16845

0 of 2 tasks complete
@colinfrei

This comment has been minimized.

Contributor

colinfrei commented Sep 26, 2018

Hi - sorry for the late response.
Looks good to me, and the breaking change makes sense. I'm probably the wrong person to evaluate the code itself though :)
Happy to see this expanded on - thanks @GP8x!

@balloob balloob referenced this pull request Oct 12, 2018

Merged

0.80.0 #17361

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment