-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Mill room temp #18203
Conversation
@@ -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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
Description:
Mill room temp
Checklist:
tox
. Your PR cannot be merged unless tests passIf the code communicates with devices, web services, or third-party tools:
REQUIREMENTS
variable ([example][ex-requir]).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.