Skip to content

Mill room temp#18203

Merged
Danielhiversen merged 3 commits intodevfrom
mill_attr
Nov 5, 2018
Merged

Mill room temp#18203
Danielhiversen merged 3 commits intodevfrom
mill_attr

Conversation

@Danielhiversen
Copy link
Copy Markdown
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
"""Return the state attributes."""
if self._heater.room:
room = self._heater.room.name
avg_room_temp = self._heater.room.avg_temp
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.

shouldn't this be the value returned from current_temperature ?

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

"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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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.

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.

4 participants