mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Mill device state attributes (#17834)
* Mill device state attributes * lower case
This commit is contained in:
parent
6b7cbca04c
commit
21870e2167
@ -8,16 +8,18 @@ https://home-assistant.io/components/climate.mill/
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.climate import (
|
from homeassistant.components.climate import (
|
||||||
ClimateDevice, PLATFORM_SCHEMA, SUPPORT_TARGET_TEMPERATURE,
|
ClimateDevice, PLATFORM_SCHEMA,
|
||||||
SUPPORT_FAN_MODE, SUPPORT_ON_OFF)
|
SUPPORT_TARGET_TEMPERATURE, SUPPORT_FAN_MODE,
|
||||||
|
SUPPORT_ON_OFF)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_TEMPERATURE, CONF_PASSWORD, CONF_USERNAME,
|
ATTR_TEMPERATURE, CONF_PASSWORD, CONF_USERNAME,
|
||||||
STATE_ON, STATE_OFF, TEMP_CELSIUS)
|
STATE_ON, STATE_OFF, TEMP_CELSIUS)
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
|
|
||||||
REQUIREMENTS = ['millheater==0.2.0']
|
REQUIREMENTS = ['millheater==0.2.1']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -43,8 +45,7 @@ async def async_setup_platform(hass, config, async_add_entities,
|
|||||||
_LOGGER.error("Failed to connect to Mill")
|
_LOGGER.error("Failed to connect to Mill")
|
||||||
return
|
return
|
||||||
|
|
||||||
await mill_data_connection.update_rooms()
|
await mill_data_connection.find_all_heaters()
|
||||||
await mill_data_connection.update_heaters()
|
|
||||||
|
|
||||||
dev = []
|
dev = []
|
||||||
for heater in mill_data_connection.heaters.values():
|
for heater in mill_data_connection.heaters.values():
|
||||||
@ -80,6 +81,17 @@ class MillHeater(ClimateDevice):
|
|||||||
"""Return the name of the entity."""
|
"""Return the name of the entity."""
|
||||||
return self._heater.name
|
return self._heater.name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def device_state_attributes(self):
|
||||||
|
"""Return the state attributes."""
|
||||||
|
if self._heater.room:
|
||||||
|
room = self._heater.room.name
|
||||||
|
else:
|
||||||
|
room = "Independent device"
|
||||||
|
return {"room": room,
|
||||||
|
"open_window": self._heater.open_window,
|
||||||
|
"heating": self._heater.is_heating}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def temperature_unit(self):
|
def temperature_unit(self):
|
||||||
"""Return the unit of measurement which this thermostat uses."""
|
"""Return the unit of measurement which this thermostat uses."""
|
||||||
|
@ -612,7 +612,7 @@ mficlient==0.3.0
|
|||||||
miflora==0.4.0
|
miflora==0.4.0
|
||||||
|
|
||||||
# homeassistant.components.climate.mill
|
# homeassistant.components.climate.mill
|
||||||
millheater==0.2.0
|
millheater==0.2.1
|
||||||
|
|
||||||
# homeassistant.components.sensor.mitemp_bt
|
# homeassistant.components.sensor.mitemp_bt
|
||||||
mitemp_bt==0.0.1
|
mitemp_bt==0.0.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user