Skip to content

Commit

Permalink
Merge 2c67c22 into c33e93b
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-w committed Feb 15, 2019
2 parents c33e93b + 2c67c22 commit 0cebf47
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/climate.md
Expand Up @@ -39,7 +39,8 @@ groups:

* **group_address_temperature** KNX address of current room temperature
* **group_address_setpoint** KNX address of basis setpoint.
* **group_address_target_temperature** KNX address for reading the target temperature from KNX bus.
* **group_address_target_temperature** KNX address for setting the target temperature if setpoint shift is unsupported.
* **group_address_target_temperature_state** KNX address for reading the target temperature from the KNX bus.
* **group_address_operation_mode** KNX address for operation mode.

* **group_address_operation_mode_protection** KNX address for switching on/off frost/heat protection mode.
Expand Down
10 changes: 7 additions & 3 deletions home-assistant-plugin/custom_components/xknx/climate.py
Expand Up @@ -25,6 +25,7 @@
CONF_SETPOINT_SHIFT_MIN = 'setpoint_shift_min'
CONF_TEMPERATURE_ADDRESS = 'temperature_address'
CONF_TARGET_TEMPERATURE_ADDRESS = 'target_temperature_address'
CONF_TARGET_TEMPERATURE_STATE_ADDRESS = 'target_temperature_state_address'
CONF_OPERATION_MODE_ADDRESS = 'operation_mode_address'
CONF_OPERATION_MODE_STATE_ADDRESS = 'operation_mode_state_address'
CONF_CONTROLLER_STATUS_ADDRESS = 'controller_status_address'
Expand Down Expand Up @@ -66,6 +67,7 @@
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Required(CONF_TEMPERATURE_ADDRESS): cv.string,
vol.Required(CONF_TARGET_TEMPERATURE_ADDRESS): cv.string,
vol.Optional(CONF_TARGET_TEMPERATURE_STATE_ADDRESS): cv.string,
vol.Optional(CONF_SETPOINT_SHIFT_ADDRESS): cv.string,
vol.Optional(CONF_SETPOINT_SHIFT_STATE_ADDRESS): cv.string,
vol.Optional(CONF_SETPOINT_SHIFT_STEP,
Expand Down Expand Up @@ -144,9 +146,11 @@ def async_add_entities_config(hass, config, async_add_entities):
climate = xknx.devices.Climate(
hass.data[DATA_XKNX].xknx,
name=config.get(CONF_NAME),
group_address_temperature=config.get(CONF_TEMPERATURE_ADDRESS),
group_address_target_temperature=config.get(
CONF_TARGET_TEMPERATURE_ADDRESS),
group_address_temperature=config[CONF_TEMPERATURE_ADDRESS],
group_address_target_temperature=
config[CONF_TARGET_TEMPERATURE_ADDRESS],
group_address_target_temperature_state=
config.get(CONF_TARGET_TEMPERATURE_STATE_ADDRESS),
group_address_setpoint_shift=config.get(CONF_SETPOINT_SHIFT_ADDRESS),
group_address_setpoint_shift_state=config.get(
CONF_SETPOINT_SHIFT_STATE_ADDRESS),
Expand Down
9 changes: 9 additions & 0 deletions xknx/devices/climate.py
Expand Up @@ -28,6 +28,7 @@ def __init__(self,
name,
group_address_temperature=None,
group_address_target_temperature=None,
group_address_target_temperature_state=None,
group_address_setpoint_shift=None,
group_address_setpoint_shift_state=None,
setpoint_shift_step=DEFAULT_SETPOINT_SHIFT_STEP,
Expand Down Expand Up @@ -61,6 +62,7 @@ def __init__(self,
self.target_temperature = RemoteValueTemp(
xknx,
group_address_target_temperature,
group_address_target_temperature_state,
device_name=self.name,
after_update_cb=self.after_update)
self.setpoint_shift = RemoteValue1Count(
Expand Down Expand Up @@ -95,6 +97,8 @@ def from_config(cls, xknx, name, config):
config.get('group_address_temperature')
group_address_target_temperature = \
config.get('group_address_target_temperature')
group_address_target_temperature_state = \
config.get('group_address_target_temperature_state')
group_address_setpoint_shift = \
config.get('group_address_setpoint_shift')
group_address_setpoint_shift_state = \
Expand All @@ -109,6 +113,8 @@ def from_config(cls, xknx, name, config):
config.get('group_address_on_off')
group_address_on_off_state = \
config.get('group_address_on_off_state')
min_temp = config.get('min_temp')
max_temp = config.get('max_temp')

climate_mode = None
if "mode" in config:
Expand All @@ -121,13 +127,16 @@ def from_config(cls, xknx, name, config):
name,
group_address_temperature=group_address_temperature,
group_address_target_temperature=group_address_target_temperature,
group_address_target_temperature_state=group_address_target_temperature_state,
group_address_setpoint_shift=group_address_setpoint_shift,
group_address_setpoint_shift_state=group_address_setpoint_shift_state,
setpoint_shift_step=setpoint_shift_step,
setpoint_shift_max=setpoint_shift_max,
setpoint_shift_min=setpoint_shift_min,
group_address_on_off=group_address_on_off,
group_address_on_off_state=group_address_on_off_state,
min_temp=min_temp,
max_temp=max_temp,
mode=climate_mode)

def has_group_address(self, group_address):
Expand Down

0 comments on commit 0cebf47

Please sign in to comment.