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

Add voluptuous to Loopenergy #2890

Merged
merged 2 commits into from
Aug 20, 2016
Merged

Add voluptuous to Loopenergy #2890

merged 2 commits into from
Aug 20, 2016

Conversation

pavoni
Copy link
Contributor

@pavoni pavoni commented Aug 19, 2016

Description:
This adds voluptuous to Loopevergy.

It also makes a breaking change to the config of this (little used) sensor to use a revised config structure nesting the config data to make validation easier.

Related issue (if applicable): fixes #

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

Example entry for configuration.yaml (if applicable):

New

sensor:
  - platform: loopenergy
    electricity:
      electricity_serial: 'xxx'
      electricity_secret: 'yyy'
    gas:
      gas_serial: 'xxx'
      gas_secret: 'yyy'
      gas_type: imperial
      gas_calorific: 38.2

Old

sensor:
  - platform: loopenergy
    electricity_serial: 'xxx'
    electricity_secret: 'yyy'
    gas_serial: 'xxx'
    gas_secret: 'yyy'
    gas_type: imperial
    gas_calorific: 38.2

Checklist:

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

If code communicates with devices, web services, or a:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

.# Please enter the commit message for your changes. Lines starting

.# Please enter the commit message for your changes. Lines starting
@pavoni pavoni changed the title Add voluptuous to Loopevergy Add voluptuous to Loopenergy Aug 19, 2016
@fabaff fabaff mentioned this pull request Aug 19, 2016
REQUIREMENTS = ['pyloopenergy==0.0.14']

CONFIG_ELEC = 'electricity'
Copy link
Member

Choose a reason for hiding this comment

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

For the sake of consistency I would like to suggest that we use CONF_ as prefix for configuration relevant constants. Sorry, it's a bit petty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem. Hopefully sorted.

@fabaff
Copy link
Member

fabaff commented Aug 20, 2016

Looks good to me.

Another addition for the future could be to use the unit_system: value of the configuration for gas_type as default.

@pavoni
Copy link
Contributor Author

pavoni commented Aug 20, 2016

Thanks @fabaff. Are you happy for me to merge?

I think these guys only sell their product in the UK - and the type of gas meter you have is more related to when it was fitted to your home, rather than the local measurement convention, so not sure linking to the unit_system is much of a win.

@fabaff
Copy link
Member

fabaff commented Aug 20, 2016

Are you happy for me to merge?

I am.

@pavoni pavoni merged commit 2df8524 into dev Aug 20, 2016
@pavoni pavoni deleted the loop_energy_voluptuous branch August 20, 2016 14:34
@pavoni
Copy link
Contributor Author

pavoni commented Aug 20, 2016

Thanks.

@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
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