Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def supported_operation_modes():
"""Return a list of the configured operation mode."""
return [HVACOperationMode.HEAT,
HVACOperationMode.COOL]
def guess_operation_modes(self):
"""Guess operation modes from group addresses."""
# All operation modes supported
if self.group_address_operation_mode is not None:
return [HVACOperationMode.AUTO, HVACOperationMode.COMFORT,
HVACOperationMode.STANDBY, HVACOperationMode.NIGHT,
HVACOperationMode.FROST_PROTECTION]
if self.group_address_controller_status is not None:
return [HVACOperationMode.COMFORT, HVACOperationMode.STANDBY,
HVACOperationMode.NIGHT, HVACOperationMode.FROST_PROTECTION]
if self.group_address_controller_mode is not None:
return [HVACOperationMode.STANDBY, HVACOperationMode.AUTO, HVACOperationMode.HEAT,
HVACOperationMode.COOL, HVACOperationMode.FAN_ONLY, HVACOperationMode.DRY]
# Operation modes only supported partially
operation_modes = []
if self.group_address_operation_mode_comfort:
operation_modes.append(HVACOperationMode.COMFORT)
operation_modes.append(HVACOperationMode.STANDBY)
if self.group_address_operation_mode_night:
operation_modes.append(HVACOperationMode.NIGHT)
def supported_operation_modes():
"""Return a list of the configured operation mode."""
return [HVACOperationMode.COMFORT,
HVACOperationMode.FROST_PROTECTION,
HVACOperationMode.NIGHT,
HVACOperationMode.STANDBY]
def guess_operation_modes(self):
"""Guess operation modes from group addresses."""
# All operation modes supported
if self.group_address_operation_mode is not None:
return [HVACOperationMode.AUTO, HVACOperationMode.COMFORT,
HVACOperationMode.STANDBY, HVACOperationMode.NIGHT,
HVACOperationMode.FROST_PROTECTION]
if self.group_address_controller_status is not None:
return [HVACOperationMode.COMFORT, HVACOperationMode.STANDBY,
HVACOperationMode.NIGHT, HVACOperationMode.FROST_PROTECTION]
if self.group_address_controller_mode is not None:
return [HVACOperationMode.STANDBY, HVACOperationMode.AUTO, HVACOperationMode.HEAT,
HVACOperationMode.COOL, HVACOperationMode.FAN_ONLY, HVACOperationMode.DRY]
# Operation modes only supported partially
operation_modes = []
if self.group_address_operation_mode_comfort:
operation_modes.append(HVACOperationMode.COMFORT)
operation_modes.append(HVACOperationMode.STANDBY)
if self.group_address_operation_mode_night:
operation_modes.append(HVACOperationMode.NIGHT)
if self.group_address_operation_mode_protection:
operation_modes.append(HVACOperationMode.FROST_PROTECTION)
return operation_modes
if self.group_address_operation_mode is not None:
return [HVACOperationMode.AUTO, HVACOperationMode.COMFORT,
HVACOperationMode.STANDBY, HVACOperationMode.NIGHT,
HVACOperationMode.FROST_PROTECTION]
if self.group_address_controller_status is not None:
return [HVACOperationMode.COMFORT, HVACOperationMode.STANDBY,
HVACOperationMode.NIGHT, HVACOperationMode.FROST_PROTECTION]
if self.group_address_controller_mode is not None:
return [HVACOperationMode.STANDBY, HVACOperationMode.AUTO, HVACOperationMode.HEAT,
HVACOperationMode.COOL, HVACOperationMode.FAN_ONLY, HVACOperationMode.DRY]
# Operation modes only supported partially
operation_modes = []
if self.group_address_operation_mode_comfort:
operation_modes.append(HVACOperationMode.COMFORT)
operation_modes.append(HVACOperationMode.STANDBY)
if self.group_address_operation_mode_night:
operation_modes.append(HVACOperationMode.NIGHT)
if self.group_address_operation_mode_protection:
operation_modes.append(HVACOperationMode.FROST_PROTECTION)
return operation_modes
def supported_operation_modes():
"""Return a list of the configured operation mode."""
return [HVACOperationMode.HEAT,
HVACOperationMode.COOL]
def guess_operation_modes(self):
"""Guess operation modes from group addresses."""
# All operation modes supported
if self.group_address_operation_mode is not None:
return [HVACOperationMode.AUTO, HVACOperationMode.COMFORT,
HVACOperationMode.STANDBY, HVACOperationMode.NIGHT,
HVACOperationMode.FROST_PROTECTION]
if self.group_address_controller_status is not None:
return [HVACOperationMode.COMFORT, HVACOperationMode.STANDBY,
HVACOperationMode.NIGHT, HVACOperationMode.FROST_PROTECTION]
if self.group_address_controller_mode is not None:
return [HVACOperationMode.STANDBY, HVACOperationMode.AUTO, HVACOperationMode.HEAT,
HVACOperationMode.COOL, HVACOperationMode.FAN_ONLY, HVACOperationMode.DRY]
# Operation modes only supported partially
operation_modes = []
if self.group_address_operation_mode_comfort:
operation_modes.append(HVACOperationMode.COMFORT)
operation_modes.append(HVACOperationMode.STANDBY)
if self.group_address_operation_mode_night:
operation_modes.append(HVACOperationMode.NIGHT)
if self.group_address_operation_mode_protection:
def guess_operation_modes(self):
"""Guess operation modes from group addresses."""
# All operation modes supported
if self.group_address_operation_mode is not None:
return [HVACOperationMode.AUTO, HVACOperationMode.COMFORT,
HVACOperationMode.STANDBY, HVACOperationMode.NIGHT,
HVACOperationMode.FROST_PROTECTION]
if self.group_address_controller_status is not None:
return [HVACOperationMode.COMFORT, HVACOperationMode.STANDBY,
HVACOperationMode.NIGHT, HVACOperationMode.FROST_PROTECTION]
if self.group_address_controller_mode is not None:
return [HVACOperationMode.STANDBY, HVACOperationMode.AUTO, HVACOperationMode.HEAT,
HVACOperationMode.COOL, HVACOperationMode.FAN_ONLY, HVACOperationMode.DRY]
# Operation modes only supported partially
operation_modes = []
if self.group_address_operation_mode_comfort:
operation_modes.append(HVACOperationMode.COMFORT)
operation_modes.append(HVACOperationMode.STANDBY)
if self.group_address_operation_mode_night:
operation_modes.append(HVACOperationMode.NIGHT)
if self.group_address_operation_mode_protection:
operation_modes.append(HVACOperationMode.FROST_PROTECTION)
return operation_modes
def __init__(self,
xknx,
group_address=None,
group_address_state=None,
sync_state=True,
device_name=None,
feature_name="Climate Mode Binary",
after_update_cb=None,
operation_mode=None):
"""Initialize remote value of KNX DPT 1 representing a climate operation mode."""
# pylint: disable=too-many-arguments
if not isinstance(operation_mode, HVACOperationMode):
raise ConversionError("Invalid operation mode type",
operation_mode=operation_mode, device_name=device_name, feature_name=feature_name)
if operation_mode not in self.supported_operation_modes():
raise ConversionError("Operation mode not supported for binary mode object",
operation_mode=operation_mode, device_name=device_name, feature_name=feature_name)
self.operation_mode = operation_mode
super().__init__(xknx,
group_address=group_address,
group_address_state=group_address_state,
sync_state=True,
device_name=device_name,
feature_name=feature_name,
after_update_cb=after_update_cb)