mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
parent
32cb666dac
commit
98163504fb
@ -10,7 +10,7 @@ import logging
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.climate import (
|
from homeassistant.components.climate import (
|
||||||
ClimateDevice, PLATFORM_SCHEMA,
|
ClimateDevice, DOMAIN, PLATFORM_SCHEMA,
|
||||||
SUPPORT_TARGET_TEMPERATURE, SUPPORT_FAN_MODE,
|
SUPPORT_TARGET_TEMPERATURE, SUPPORT_FAN_MODE,
|
||||||
SUPPORT_ON_OFF)
|
SUPPORT_ON_OFF)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
@ -19,12 +19,18 @@ from homeassistant.const import (
|
|||||||
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.1']
|
REQUIREMENTS = ['millheater==0.2.2']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
ATTR_AWAY_TEMP = 'away_temp'
|
||||||
|
ATTR_COMFORT_TEMP = 'comfort_temp'
|
||||||
|
ATTR_ROOM_NAME = 'room_name'
|
||||||
|
ATTR_SLEEP_TEMP = 'sleep_temp'
|
||||||
MAX_TEMP = 35
|
MAX_TEMP = 35
|
||||||
MIN_TEMP = 5
|
MIN_TEMP = 5
|
||||||
|
SERVICE_SET_ROOM_TEMP = 'mill_set_room_temperature'
|
||||||
|
|
||||||
SUPPORT_FLAGS = (SUPPORT_TARGET_TEMPERATURE |
|
SUPPORT_FLAGS = (SUPPORT_TARGET_TEMPERATURE |
|
||||||
SUPPORT_FAN_MODE | SUPPORT_ON_OFF)
|
SUPPORT_FAN_MODE | SUPPORT_ON_OFF)
|
||||||
|
|
||||||
@ -33,6 +39,13 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||||||
vol.Required(CONF_PASSWORD): cv.string,
|
vol.Required(CONF_PASSWORD): cv.string,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
SET_ROOM_TEMP_SCHEMA = vol.Schema({
|
||||||
|
vol.Required(ATTR_ROOM_NAME): cv.string,
|
||||||
|
vol.Optional(ATTR_AWAY_TEMP): cv.positive_int,
|
||||||
|
vol.Optional(ATTR_COMFORT_TEMP): cv.positive_int,
|
||||||
|
vol.Optional(ATTR_SLEEP_TEMP): cv.positive_int,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_platform(hass, config, async_add_entities,
|
async def async_setup_platform(hass, config, async_add_entities,
|
||||||
discovery_info=None):
|
discovery_info=None):
|
||||||
@ -52,6 +65,20 @@ async def async_setup_platform(hass, config, async_add_entities,
|
|||||||
dev.append(MillHeater(heater, mill_data_connection))
|
dev.append(MillHeater(heater, mill_data_connection))
|
||||||
async_add_entities(dev)
|
async_add_entities(dev)
|
||||||
|
|
||||||
|
async def set_room_temp(service):
|
||||||
|
"""Set room temp."""
|
||||||
|
room_name = service.data.get(ATTR_ROOM_NAME)
|
||||||
|
sleep_temp = service.data.get(ATTR_SLEEP_TEMP)
|
||||||
|
comfort_temp = service.data.get(ATTR_COMFORT_TEMP)
|
||||||
|
away_temp = service.data.get(ATTR_AWAY_TEMP)
|
||||||
|
await mill_data_connection.set_room_temperatures_by_name(room_name,
|
||||||
|
sleep_temp,
|
||||||
|
comfort_temp,
|
||||||
|
away_temp)
|
||||||
|
|
||||||
|
hass.services.async_register(DOMAIN, SERVICE_SET_ROOM_TEMP,
|
||||||
|
set_room_temp, schema=SET_ROOM_TEMP_SCHEMA)
|
||||||
|
|
||||||
|
|
||||||
class MillHeater(ClimateDevice):
|
class MillHeater(ClimateDevice):
|
||||||
"""Representation of a Mill Thermostat device."""
|
"""Representation of a Mill Thermostat device."""
|
||||||
@ -88,9 +115,12 @@ class MillHeater(ClimateDevice):
|
|||||||
room = self._heater.room.name
|
room = self._heater.room.name
|
||||||
else:
|
else:
|
||||||
room = "Independent device"
|
room = "Independent device"
|
||||||
return {"room": room,
|
return {
|
||||||
"open_window": self._heater.open_window,
|
"room": room,
|
||||||
"heating": self._heater.is_heating}
|
"open_window": self._heater.open_window,
|
||||||
|
"heating": self._heater.is_heating,
|
||||||
|
"controlled_by_tibber": self._heater.tibber_control,
|
||||||
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def temperature_unit(self):
|
def temperature_unit(self):
|
||||||
|
@ -116,6 +116,22 @@ ecobee_resume_program:
|
|||||||
description: Resume all events and return to the scheduled program. This default to false which removes only the top event.
|
description: Resume all events and return to the scheduled program. This default to false which removes only the top event.
|
||||||
example: true
|
example: true
|
||||||
|
|
||||||
|
mill_set_room_temperature:
|
||||||
|
description: Set Mill room temperatures.
|
||||||
|
fields:
|
||||||
|
room_name:
|
||||||
|
description: Name of room to change.
|
||||||
|
example: 'kitchen'
|
||||||
|
away_temp:
|
||||||
|
description: Away temp.
|
||||||
|
example: 12
|
||||||
|
comfort_temp:
|
||||||
|
description: Comfort temp.
|
||||||
|
example: 22
|
||||||
|
sleep_temp:
|
||||||
|
description: Sleep temp.
|
||||||
|
example: 17
|
||||||
|
|
||||||
nuheat_resume_program:
|
nuheat_resume_program:
|
||||||
description: Resume the programmed schedule.
|
description: Resume the programmed schedule.
|
||||||
fields:
|
fields:
|
||||||
|
@ -615,7 +615,7 @@ mficlient==0.3.0
|
|||||||
miflora==0.4.0
|
miflora==0.4.0
|
||||||
|
|
||||||
# homeassistant.components.climate.mill
|
# homeassistant.components.climate.mill
|
||||||
millheater==0.2.1
|
millheater==0.2.2
|
||||||
|
|
||||||
# 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