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

Mill room temp #18203

Merged
merged 3 commits into from
Nov 5, 2018
Merged

Mill room temp #18203

merged 3 commits into from
Nov 5, 2018

Conversation

Danielhiversen
Copy link
Member

Description:

Mill room temp

Checklist:

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

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.

Daniel Høyer Iversen and others added 2 commits November 4, 2018 16:58
@ghost ghost assigned Danielhiversen Nov 4, 2018
@ghost ghost added the in progress label Nov 4, 2018
@@ -114,13 +114,16 @@ def device_state_attributes(self):
"""Return the state attributes."""
if self._heater.room:
room = self._heater.room.name
avg_room_temp = self._heater.room.avg_temp
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be the value returned from current_temperature ?

Copy link
Member Author

@Danielhiversen Danielhiversen Nov 4, 2018

Choose a reason for hiding this comment

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

No, you can have several heaters in one room (Defined by Mill app). This will be the average temperature for all heaters in that room.

return {
"room": room,
"open_window": self._heater.open_window,
"heating": self._heater.is_heating,
"controlled_by_tibber": self._heater.tibber_control,
"avg_room_temp": avg_room_temp,
Copy link
Member

Choose a reason for hiding this comment

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

We usually don't populate device state attributes with items where the value is None. Maybe we should check that here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, so if it is None, we do not add it?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's an existing pattern.

Copy link
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.

Can be merged when build passes.

@Danielhiversen Danielhiversen merged commit 93b16e7 into dev Nov 5, 2018
@Danielhiversen Danielhiversen deleted the mill_attr branch November 5, 2018 19:52
@ghost ghost removed the in progress label Nov 5, 2018
@balloob balloob mentioned this pull request Nov 29, 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.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants