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 a component for GreenEye Monitor #16378

Merged
merged 7 commits into from Nov 1, 2018

Conversation

Projects
None yet
4 participants
@jkeljo
Contributor

jkeljo commented Sep 3, 2018

Description:

GreenEye Monitor is an energy
monitor that can monitor emergy usage of individual circuits, count pulses
from things like water or gas meters, and monitor temperatures. This component
exposes these various sensors in Home Assistant, for both data tracking and
automation triggering purposes.

Related issue (if applicable): n/a

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

Example entry for configuration.yaml (if applicable):

greeneye_monitor:
  port: 8000
  monitors:
    - serial_number: YOUR_SERIAL_NUMBER
      channels:
        - number: 1
          name: total_power
        - number: 2
          name: solar_panels_power
          net_metering: true
      pulse_counters:
        - number: 1
          name: sprinklers_water_usage
          counted_quantity: "gal"
          counted_quantity_per_pulse: 1
          time_unit: "min"
      temperature_sensors:
        - number: 1
          name: back_porch_temperature

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.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@MartinHjelmare

Consolidate the platforms into one sensor platform that adds the correct entity type based on the component config schema option sent as discovery info.

@jkeljo jkeljo force-pushed the jkeljo:greeneye-monitor branch from eea8042 to 57c8b41 Oct 24, 2018

@jkeljo

This comment has been minimized.

Contributor

jkeljo commented Oct 24, 2018

Sorry for the delay! Rebased on a more recent dev branch and refactored as requested.

Show resolved Hide resolved homeassistant/components/greeneye_monitor.py Outdated
Show resolved Hide resolved homeassistant/components/greeneye_monitor.py Outdated
Show resolved Hide resolved homeassistant/components/greeneye_monitor.py Outdated
Show resolved Hide resolved homeassistant/components/greeneye_monitor.py Outdated
Show resolved Hide resolved homeassistant/components/greeneye_monitor.py
Show resolved Hide resolved homeassistant/components/sensor/greeneye_monitor.py Outdated
Show resolved Hide resolved homeassistant/components/greeneye_monitor.py
Show resolved Hide resolved homeassistant/components/sensor/greeneye_monitor.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/greeneye_monitor.py Outdated
Show resolved Hide resolved homeassistant/components/greeneye_monitor.py Outdated
@MartinHjelmare

Looks great. One comment.

Show resolved Hide resolved homeassistant/components/greeneye_monitor.py Outdated
Show resolved Hide resolved homeassistant/components/greeneye_monitor.py Outdated
@MartinHjelmare

Great! Can be merged when build passes.

jkeljo added some commits Jun 18, 2018

Add a component for GreenEye Monitor
[GreenEye Monitor](http://www.brultech.com/greeneye/) is an energy
monitor that can monitor emergy usage of individual circuits, count pulses
from things like water or gas meters, and monitor temperatures. This component
exposes these various sensors in Home Assistant, for both data tracking and
automation triggering purposes.
- cv.ensure_list
- DOMAIN, where appropriate
- defaults to schema
- single invocation of async_load_platform
- async_create_task instead of async_add_job
- fail if no sensors
- monitors required
- async_add_entities
- call add_devices once
- remove unused schema
- use properties rather than set fields
- move _number and unique_id to GEMSensor
- remove unnecessary get(xxx, None)
- keep params on one line when possible
- new-style string format

@jkeljo jkeljo force-pushed the jkeljo:greeneye-monitor branch from 6d0b762 to cc87f43 Nov 1, 2018

@jkeljo

This comment has been minimized.

Contributor

jkeljo commented Nov 1, 2018

Rebased on dev to see if that makes coverage happy

@MartinHjelmare

🎉

@MartinHjelmare MartinHjelmare merged commit 19ebdf2 into home-assistant:dev Nov 1, 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 increased (+0.002%) to 93.141%
Details

@wafflebot wafflebot bot removed the in progress label Nov 1, 2018

@balloob balloob referenced this pull request Nov 9, 2018

Merged

0.82 #18335

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