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 device condition for water heater #28913

Open
wants to merge 3 commits into
base: dev
from

Conversation

@shmooey
Copy link
Contributor

shmooey commented Nov 21, 2019

Description:

Adds basic device condition support for water_heater integration - off, eco, electric, performance, high demand, heat pump, gas

Related issue (if applicable): fixes #27007

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]

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

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@MartinHjelmare MartinHjelmare added this to Needs review in Dev Nov 21, 2019
@MartinHjelmare MartinHjelmare changed the title Added device condition for water heater Add device condition for water heater Nov 21, 2019
CONF_TYPE: "is_gas",
}
)

This comment has been minimized.

Copy link
@dgomes

dgomes Nov 21, 2019

Contributor

May I suggest replacing all these lines with:

conditions+=[{
                 CONF_CONDITION: "device",
                 CONF_DEVICE_ID: device_id,
                 CONF_DOMAIN: DOMAIN,
                 CONF_ENTITY_ID: entry.entity_id,
                 CONF_TYPE: conf_type,
             } for conf_type in CONDITIONS_TYPE]

This comment has been minimized.

Copy link
@shmooey

shmooey Nov 21, 2019

Author Contributor

I can definitely do that. Thanks for the suggestion!

@shmooey shmooey force-pushed the shmooey:issue-27007 branch from 37e585d to dfdd2f3 Dec 1, 2019
@shmooey shmooey force-pushed the shmooey:issue-27007 branch from dfdd2f3 to 3c62c39 Dec 5, 2019
@shmooey

This comment has been minimized.

Copy link
Contributor Author

shmooey commented Dec 5, 2019

I was getting a run mypy error for /water_heater/device_condition.py:51 "Need type annotation for 'conditions' (hint: "conditions: List[] = ..."). I looked through some previous device condition PR's and changed "conditions = []" to "conditions: List[dict] = []". It seems to work but I'm not sure if it's the correct way to fix the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Dev
  
Needs review
3 participants
You can’t perform that action at this time.