Adding helper for get and set values (#5743)
* cleanup * Update __init__.py * Update __init__.py * Update __init__.pypull/5830/head
parent
c550a316a4
commit
298575f7cb
|
@ -83,42 +83,49 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
|
|||
def update_properties(self):
|
||||
"""Callback on data changes for node values."""
|
||||
# Operation Mode
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_MODE).values():
|
||||
self._current_operation = value.data
|
||||
self._operation_list = list(value.data_items)
|
||||
self._current_operation = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_MODE, member='data')
|
||||
operation_list = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_MODE,
|
||||
member='data_items')
|
||||
if operation_list:
|
||||
self._operation_list = list(operation_list)
|
||||
_LOGGER.debug("self._operation_list=%s", self._operation_list)
|
||||
_LOGGER.debug("self._current_operation=%s",
|
||||
self._current_operation)
|
||||
_LOGGER.debug("self._current_operation=%s", self._current_operation)
|
||||
|
||||
# Current Temp
|
||||
for value in (
|
||||
self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_SENSOR_MULTILEVEL)
|
||||
.values()):
|
||||
if value.label == 'Temperature':
|
||||
self._current_temperature = round((float(value.data)), 1)
|
||||
self._unit = value.units
|
||||
self._current_temperature = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_SENSOR_MULTILEVEL,
|
||||
label=['Temperature'], member='data')
|
||||
self._unit = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_SENSOR_MULTILEVEL,
|
||||
label=['Temperature'], member='units')
|
||||
|
||||
# Fan Mode
|
||||
for value in (
|
||||
self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_FAN_MODE)
|
||||
.values()):
|
||||
self._current_fan_mode = value.data
|
||||
self._fan_list = list(value.data_items)
|
||||
self._current_fan_mode = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_FAN_MODE,
|
||||
member='data')
|
||||
fan_list = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_FAN_MODE,
|
||||
member='data_items')
|
||||
if fan_list:
|
||||
self._fan_list = list(fan_list)
|
||||
_LOGGER.debug("self._fan_list=%s", self._fan_list)
|
||||
_LOGGER.debug("self._current_fan_mode=%s",
|
||||
self._current_fan_mode)
|
||||
# Swing mode
|
||||
if self._zxt_120 == 1:
|
||||
for value in (
|
||||
self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_CONFIGURATION)
|
||||
.values()):
|
||||
if value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_CONFIGURATION and \
|
||||
value.index == 33:
|
||||
self._current_swing_mode = value.data
|
||||
self._swing_list = list(value.data_items)
|
||||
self._current_swing_mode = (
|
||||
self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_CONFIGURATION,
|
||||
index=33,
|
||||
member='data'))
|
||||
swing_list = self.get_value(class_id=zwave.const
|
||||
.COMMAND_CLASS_CONFIGURATION,
|
||||
index=33,
|
||||
member='data_items')
|
||||
if swing_list:
|
||||
self._swing_list = list(swing_list)
|
||||
_LOGGER.debug("self._swing_list=%s", self._swing_list)
|
||||
_LOGGER.debug("self._current_swing_mode=%s",
|
||||
self._current_swing_mode)
|
||||
|
@ -139,19 +146,16 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
|
|||
break
|
||||
else:
|
||||
self._target_temperature = round((float(value.data)), 1)
|
||||
|
||||
# Operating state
|
||||
for value in (
|
||||
self._node.get_values(
|
||||
class_id=zwave.const
|
||||
.COMMAND_CLASS_THERMOSTAT_OPERATING_STATE).values()):
|
||||
self._operating_state = value.data
|
||||
self._operating_state = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_OPERATING_STATE,
|
||||
member='data')
|
||||
|
||||
# Fan operating state
|
||||
for value in (
|
||||
self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_FAN_STATE)
|
||||
.values()):
|
||||
self._fan_state = value.data
|
||||
self._fan_state = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_FAN_STATE,
|
||||
member='data')
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
|
@ -215,50 +219,29 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
|
|||
else:
|
||||
return
|
||||
|
||||
for value in (self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_SETPOINT)
|
||||
.values()):
|
||||
if value.index == self._index:
|
||||
if self._zxt_120:
|
||||
# ZXT-120 responds only to whole int
|
||||
value.data = round(temperature, 0)
|
||||
self._target_temperature = temperature
|
||||
self.schedule_update_ha_state()
|
||||
else:
|
||||
value.data = temperature
|
||||
self.schedule_update_ha_state()
|
||||
break
|
||||
self.set_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_SETPOINT,
|
||||
index=self._index, data=temperature)
|
||||
self.update_ha_state()
|
||||
|
||||
def set_fan_mode(self, fan):
|
||||
"""Set new target fan mode."""
|
||||
for value in (self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_FAN_MODE).
|
||||
values()):
|
||||
if value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_THERMOSTAT_FAN_MODE and \
|
||||
value.index == 0:
|
||||
value.data = bytes(fan, 'utf-8')
|
||||
break
|
||||
self.set_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_FAN_MODE,
|
||||
index=0, data=bytes(fan, 'utf-8'))
|
||||
|
||||
def set_operation_mode(self, operation_mode):
|
||||
"""Set new target operation mode."""
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_MODE).values():
|
||||
if value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_THERMOSTAT_MODE and value.index == 0:
|
||||
value.data = bytes(operation_mode, 'utf-8')
|
||||
break
|
||||
self.set_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_MODE,
|
||||
index=0, data=bytes(operation_mode, 'utf-8'))
|
||||
|
||||
def set_swing_mode(self, swing_mode):
|
||||
"""Set new target swing mode."""
|
||||
if self._zxt_120 == 1:
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_CONFIGURATION).values():
|
||||
if value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_CONFIGURATION and \
|
||||
value.index == 33:
|
||||
value.data = bytes(swing_mode, 'utf-8')
|
||||
break
|
||||
self.set_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_CONFIGURATION,
|
||||
index=33, data=bytes(swing_mode, 'utf-8'))
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
|
|
|
@ -52,12 +52,11 @@ class ZwaveRollershutter(zwave.ZWaveDeviceEntity, CoverDevice):
|
|||
|
||||
def __init__(self, value):
|
||||
"""Initialize the zwave rollershutter."""
|
||||
import libopenzwave
|
||||
ZWaveDeviceEntity.__init__(self, value, DOMAIN)
|
||||
# pylint: disable=no-member
|
||||
self._lozwmgr = libopenzwave.PyManager()
|
||||
self._lozwmgr.create()
|
||||
self._node = value.node
|
||||
self._open_id = None
|
||||
self._close_id = None
|
||||
self._current_position = None
|
||||
self._workaround = None
|
||||
if (value.node.manufacturer_id.strip() and
|
||||
|
@ -73,12 +72,15 @@ class ZwaveRollershutter(zwave.ZWaveDeviceEntity, CoverDevice):
|
|||
def update_properties(self):
|
||||
"""Callback on data changes for node values."""
|
||||
# Position value
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL).values():
|
||||
if value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL and \
|
||||
value.label == 'Level':
|
||||
self._current_position = value.data
|
||||
self._current_position = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL,
|
||||
label=['Level'], member='data')
|
||||
self._open_id = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL,
|
||||
label=['Open', 'Up'], member='value_id')
|
||||
self._close_id = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL,
|
||||
label=['Close', 'Down'], member='value_id')
|
||||
|
||||
@property
|
||||
def is_closed(self):
|
||||
|
@ -104,27 +106,11 @@ class ZwaveRollershutter(zwave.ZWaveDeviceEntity, CoverDevice):
|
|||
|
||||
def open_cover(self, **kwargs):
|
||||
"""Move the roller shutter up."""
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL).values():
|
||||
if value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL and value.label == \
|
||||
'Open' or value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL and value.label == \
|
||||
'Up':
|
||||
self._lozwmgr.pressButton(value.value_id)
|
||||
break
|
||||
zwave.NETWORK.manager.pressButton(self._open_id)
|
||||
|
||||
def close_cover(self, **kwargs):
|
||||
"""Move the roller shutter down."""
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL).values():
|
||||
if value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL and value.label == \
|
||||
'Down' or value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL and value.label == \
|
||||
'Close':
|
||||
self._lozwmgr.pressButton(value.value_id)
|
||||
break
|
||||
zwave.NETWORK.manager.pressButton(self._close_id)
|
||||
|
||||
def set_cover_position(self, position, **kwargs):
|
||||
"""Move the roller shutter to a specific position."""
|
||||
|
@ -132,15 +118,7 @@ class ZwaveRollershutter(zwave.ZWaveDeviceEntity, CoverDevice):
|
|||
|
||||
def stop_cover(self, **kwargs):
|
||||
"""Stop the roller shutter."""
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL).values():
|
||||
if value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL and value.label == \
|
||||
'Open' or value.command_class == \
|
||||
zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL and value.label == \
|
||||
'Down':
|
||||
self._lozwmgr.releaseButton(value.value_id)
|
||||
break
|
||||
zwave.NETWORK.manager.releaseButton(self._open_id)
|
||||
|
||||
|
||||
class ZwaveGarageDoor(zwave.ZWaveDeviceEntity, CoverDevice):
|
||||
|
|
|
@ -217,11 +217,9 @@ class ZwaveColorLight(ZwaveDimmer):
|
|||
self._value_color = value_color
|
||||
|
||||
if self._value_color_channels is None:
|
||||
for value_color_channels in self._value.node.get_values(
|
||||
self._value_color_channels = self.get_value(
|
||||
class_id=zwave.const.COMMAND_CLASS_SWITCH_COLOR,
|
||||
genre=zwave.const.GENRE_SYSTEM,
|
||||
type=zwave.const.TYPE_INT).values():
|
||||
self._value_color_channels = value_color_channels
|
||||
genre=zwave.const.GENRE_SYSTEM, type=zwave.const.TYPE_INT)
|
||||
|
||||
if self._value_color and self._value_color_channels:
|
||||
_LOGGER.debug("Zwave node color values found.")
|
||||
|
|
|
@ -38,68 +38,68 @@ DEVICE_MAPPINGS = {
|
|||
}
|
||||
|
||||
LOCK_NOTIFICATION = {
|
||||
1: 'Manual Lock',
|
||||
2: 'Manual Unlock',
|
||||
3: 'RF Lock',
|
||||
4: 'RF Unlock',
|
||||
5: 'Keypad Lock',
|
||||
6: 'Keypad Unlock',
|
||||
11: 'Lock Jammed',
|
||||
254: 'Unknown Event'
|
||||
'1': 'Manual Lock',
|
||||
'2': 'Manual Unlock',
|
||||
'3': 'RF Lock',
|
||||
'4': 'RF Unlock',
|
||||
'5': 'Keypad Lock',
|
||||
'6': 'Keypad Unlock',
|
||||
'11': 'Lock Jammed',
|
||||
'254': 'Unknown Event'
|
||||
}
|
||||
|
||||
LOCK_ALARM_TYPE = {
|
||||
9: 'Deadbolt Jammed',
|
||||
18: 'Locked with Keypad by user ',
|
||||
19: 'Unlocked with Keypad by user ',
|
||||
21: 'Manually Locked by',
|
||||
22: 'Manually Unlocked by Key or Inside thumb turn',
|
||||
24: 'Locked by RF',
|
||||
25: 'Unlocked by RF',
|
||||
27: 'Auto re-lock',
|
||||
33: 'User deleted: ',
|
||||
112: 'Master code changed or User added: ',
|
||||
113: 'Duplicate Pin-code: ',
|
||||
130: 'RF module, power restored',
|
||||
161: 'Tamper Alarm: ',
|
||||
167: 'Low Battery',
|
||||
168: 'Critical Battery Level',
|
||||
169: 'Battery too low to operate'
|
||||
'9': 'Deadbolt Jammed',
|
||||
'18': 'Locked with Keypad by user ',
|
||||
'19': 'Unlocked with Keypad by user ',
|
||||
'21': 'Manually Locked by',
|
||||
'22': 'Manually Unlocked by Key or Inside thumb turn',
|
||||
'24': 'Locked by RF',
|
||||
'25': 'Unlocked by RF',
|
||||
'27': 'Auto re-lock',
|
||||
'33': 'User deleted: ',
|
||||
'112': 'Master code changed or User added: ',
|
||||
'113': 'Duplicate Pin-code: ',
|
||||
'130': 'RF module, power restored',
|
||||
'161': 'Tamper Alarm: ',
|
||||
'167': 'Low Battery',
|
||||
'168': 'Critical Battery Level',
|
||||
'169': 'Battery too low to operate'
|
||||
}
|
||||
|
||||
MANUAL_LOCK_ALARM_LEVEL = {
|
||||
1: 'Key Cylinder or Inside thumb turn',
|
||||
2: 'Touch function (lock and leave)'
|
||||
'1': 'Key Cylinder or Inside thumb turn',
|
||||
'2': 'Touch function (lock and leave)'
|
||||
}
|
||||
|
||||
TAMPER_ALARM_LEVEL = {
|
||||
1: 'Too many keypresses',
|
||||
2: 'Cover removed'
|
||||
'1': 'Too many keypresses',
|
||||
'2': 'Cover removed'
|
||||
}
|
||||
|
||||
LOCK_STATUS = {
|
||||
1: True,
|
||||
2: False,
|
||||
3: True,
|
||||
4: False,
|
||||
5: True,
|
||||
6: False,
|
||||
9: False,
|
||||
18: True,
|
||||
19: False,
|
||||
21: True,
|
||||
22: False,
|
||||
24: True,
|
||||
25: False,
|
||||
27: True
|
||||
'1': True,
|
||||
'2': False,
|
||||
'3': True,
|
||||
'4': False,
|
||||
'5': True,
|
||||
'6': False,
|
||||
'9': False,
|
||||
'18': True,
|
||||
'19': False,
|
||||
'21': True,
|
||||
'22': False,
|
||||
'24': True,
|
||||
'25': False,
|
||||
'27': True
|
||||
}
|
||||
|
||||
ALARM_TYPE_STD = [
|
||||
18,
|
||||
19,
|
||||
33,
|
||||
112,
|
||||
113
|
||||
'18',
|
||||
'19',
|
||||
'33',
|
||||
'112',
|
||||
'113'
|
||||
]
|
||||
|
||||
SET_USERCODE_SCHEMA = vol.Schema({
|
||||
|
@ -234,66 +234,58 @@ class ZwaveLock(zwave.ZWaveDeviceEntity, LockDevice):
|
|||
|
||||
def update_properties(self):
|
||||
"""Callback on data changes for node values."""
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_DOOR_LOCK).values():
|
||||
if value.type != zwave.const.TYPE_BOOL:
|
||||
continue
|
||||
if value.genre != zwave.const.GENRE_USER:
|
||||
continue
|
||||
self._state = value.data
|
||||
self._state = self.get_value(class_id=zwave
|
||||
.const.COMMAND_CLASS_DOOR_LOCK,
|
||||
type=zwave.const.TYPE_BOOL,
|
||||
genre=zwave.const.GENRE_USER,
|
||||
member='data')
|
||||
_LOGGER.debug('Lock state set from Bool value and'
|
||||
' is %s', value.data)
|
||||
break
|
||||
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_ALARM).values():
|
||||
if value.label != "Access Control":
|
||||
continue
|
||||
self._notification = LOCK_NOTIFICATION.get(value.data)
|
||||
notification_data = value.data
|
||||
' is %s', self._state)
|
||||
notification_data = self.get_value(class_id=zwave.const
|
||||
.COMMAND_CLASS_ALARM,
|
||||
label=['Access Control'],
|
||||
member='data')
|
||||
if notification_data:
|
||||
self._notification = LOCK_NOTIFICATION.get(str(notification_data))
|
||||
if self._v2btze:
|
||||
for value in (self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_CONFIGURATION)
|
||||
.values()):
|
||||
if value.index != 12:
|
||||
continue
|
||||
if value.data == CONFIG_ADVANCED:
|
||||
self._state = LOCK_STATUS.get(notification_data)
|
||||
advanced_config = self.get_value(class_id=zwave.const
|
||||
.COMMAND_CLASS_CONFIGURATION,
|
||||
index=12,
|
||||
data=CONFIG_ADVANCED,
|
||||
member='data')
|
||||
if advanced_config:
|
||||
self._state = LOCK_STATUS.get(str(notification_data))
|
||||
_LOGGER.debug('Lock state set from Access Control '
|
||||
'value and is %s', notification_data)
|
||||
break
|
||||
'value and is %s, get=%s',
|
||||
str(notification_data),
|
||||
self.state)
|
||||
|
||||
break
|
||||
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_ALARM).values():
|
||||
if value.label != "Alarm Type":
|
||||
continue
|
||||
alarm_type = value.data
|
||||
break
|
||||
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_ALARM).values():
|
||||
if value.label != "Alarm Level":
|
||||
continue
|
||||
alarm_level = value.data
|
||||
_LOGGER.debug('Lock alarm_level is %s', alarm_level)
|
||||
alarm_type = self.get_value(class_id=zwave.const
|
||||
.COMMAND_CLASS_ALARM,
|
||||
label=['Alarm Type'], member='data')
|
||||
_LOGGER.debug('Lock alarm_type is %s', str(alarm_type))
|
||||
alarm_level = self.get_value(class_id=zwave.const
|
||||
.COMMAND_CLASS_ALARM,
|
||||
label=['Alarm Level'], member='data')
|
||||
_LOGGER.debug('Lock alarm_level is %s', str(alarm_level))
|
||||
if not alarm_type:
|
||||
return
|
||||
if alarm_type is 21:
|
||||
self._lock_status = '{}{}'.format(
|
||||
LOCK_ALARM_TYPE.get(alarm_type),
|
||||
MANUAL_LOCK_ALARM_LEVEL.get(alarm_level))
|
||||
LOCK_ALARM_TYPE.get(str(alarm_type)),
|
||||
MANUAL_LOCK_ALARM_LEVEL.get(str(alarm_level)))
|
||||
if alarm_type in ALARM_TYPE_STD:
|
||||
self._lock_status = '{}{}'.format(
|
||||
LOCK_ALARM_TYPE.get(alarm_type), alarm_level)
|
||||
break
|
||||
LOCK_ALARM_TYPE.get(str(alarm_type)), str(alarm_level))
|
||||
return
|
||||
if alarm_type is 161:
|
||||
self._lock_status = '{}{}'.format(
|
||||
LOCK_ALARM_TYPE.get(alarm_type),
|
||||
TAMPER_ALARM_LEVEL.get(alarm_level))
|
||||
break
|
||||
LOCK_ALARM_TYPE.get(str(alarm_type)),
|
||||
TAMPER_ALARM_LEVEL.get(str(alarm_level)))
|
||||
return
|
||||
if alarm_type != 0:
|
||||
self._lock_status = LOCK_ALARM_TYPE.get(alarm_type)
|
||||
break
|
||||
self._lock_status = LOCK_ALARM_TYPE.get(str(alarm_type))
|
||||
return
|
||||
|
||||
@property
|
||||
def is_locked(self):
|
||||
|
|
|
@ -27,6 +27,7 @@ REQUIREMENTS = ['pydispatcher==2.0.5']
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CLASS_ID = 'class_id'
|
||||
CONF_AUTOHEAL = 'autoheal'
|
||||
CONF_DEBUG = 'debug'
|
||||
CONF_POLLING_INTENSITY = 'polling_intensity'
|
||||
|
@ -634,6 +635,47 @@ class ZWaveDeviceEntity(Entity):
|
|||
self.update_properties()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
def _value_handler(self, method=None, class_id=None, index=None,
|
||||
label=None, data=None, member=None, **kwargs):
|
||||
"""Get the values for a given command_class with arguments."""
|
||||
varname = member
|
||||
if class_id is not None:
|
||||
kwargs[CLASS_ID] = class_id
|
||||
_LOGGER.debug('method=%s, class_id=%s, index=%s, label=%s, data=%s,'
|
||||
' member=%s, kwargs=%s',
|
||||
method, class_id, index, label, data, member, kwargs)
|
||||
values = self._value.node.get_values(**kwargs).values()
|
||||
_LOGGER.debug('values=%s', values)
|
||||
if not values:
|
||||
return None
|
||||
for value in values:
|
||||
if index is not None and value.index != index:
|
||||
continue
|
||||
if label is not None:
|
||||
for entry in label:
|
||||
if entry is not None and value.label != entry:
|
||||
continue
|
||||
if method == 'set':
|
||||
value.data = data
|
||||
return
|
||||
if data is not None and value.data != data:
|
||||
continue
|
||||
if member is not None:
|
||||
results = getattr(value, varname)
|
||||
else:
|
||||
results = value
|
||||
break
|
||||
_LOGGER.debug('final result=%s', results)
|
||||
return results
|
||||
|
||||
def get_value(self, **kwargs):
|
||||
"""Simplifyer to get values."""
|
||||
return self._value_handler(method='get', **kwargs)
|
||||
|
||||
def set_value(self, **kwargs):
|
||||
"""Simplifyer to set a value."""
|
||||
return self._value_handler(method='set', **kwargs)
|
||||
|
||||
def update_properties(self):
|
||||
"""Callback on data changes for node values."""
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue