Skip to content

New climate device#17313

Merged
Danielhiversen merged 5 commits intodevfrom
mill
Oct 14, 2018
Merged

New climate device#17313
Danielhiversen merged 5 commits intodevfrom
mill

Conversation

@Danielhiversen
Copy link
Copy Markdown
Member

@Danielhiversen Danielhiversen commented Oct 10, 2018

Description:

New climate device

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

Example entry for configuration.yaml (if applicable):

climate:
 - platform: mill
   email: email@gmail.com
   password:  pswd

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][ex-requir]).
  • New dependencies are only imported inside functions that use them ([example][ex-import]).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Nice! Some small comments.

SUPPORT_FAN_MODE | SUPPORT_ON_OFF)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_EMAIL): cv.string,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We most often use CONF_USERNAME even for email username. But you decide what fits best.

async_add_entities(dev)


class MilHeater(ClimateDevice):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe call it MillHeater?

return self._heater.device_status == 0 # weird api choice

@property
def state(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overwrite is_on to communicate on/off state.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So we can remove state.

@property
def is_on(self):
"""Return true if heater is on."""
return True if self._heater.power_status == 1 else False
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

return self._heater.power_status == 1

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Great! Can be merged when build passes.

@Danielhiversen Danielhiversen merged commit a401be9 into dev Oct 14, 2018
@Danielhiversen Danielhiversen deleted the mill branch October 14, 2018 18:22
@ghost ghost removed the in progress label Oct 14, 2018
@balloob balloob mentioned this pull request Oct 26, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants