Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion homeassistant/components/climate/mill.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_get_clientsession

REQUIREMENTS = ['millheater==0.2.2']
REQUIREMENTS = ['millheater==0.2.3']

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -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
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 ?

@Danielhiversen Danielhiversen Nov 4, 2018

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.

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.

else:
room = "Independent device"
avg_room_temp = None
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
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.

}

@property
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ mficlient==0.3.0
miflora==0.4.0

# homeassistant.components.climate.mill
millheater==0.2.2
millheater==0.2.3

# homeassistant.components.sensor.mitemp_bt
mitemp_bt==0.0.1
Expand Down