Rename update_properties to update
This commit is contained in:
parent
38fe58ca56
commit
723578e7d4
5 changed files with 17 additions and 23 deletions
|
@ -68,7 +68,7 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
|
|||
self._unit = temp_unit
|
||||
_LOGGER.debug("temp_unit is %s", self._unit)
|
||||
self._zxt_120 = None
|
||||
self.update_properties()
|
||||
self.update()
|
||||
# Make sure that we have values for the key before converting to int
|
||||
if (value.node.manufacturer_id.strip() and
|
||||
value.node.product_id.strip()):
|
||||
|
@ -80,8 +80,8 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
|
|||
" workaround")
|
||||
self._zxt_120 = 1
|
||||
|
||||
def update_properties(self):
|
||||
"""Callback on data changes for node values."""
|
||||
def update(self):
|
||||
"""Get the current state of the entity."""
|
||||
# Operation Mode
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_THERMOSTAT_MODE).values():
|
||||
|
|
|
@ -70,8 +70,8 @@ class ZwaveRollershutter(zwave.ZWaveDeviceEntity, CoverDevice):
|
|||
_LOGGER.debug("Controller without positioning feedback")
|
||||
self._workaround = 1
|
||||
|
||||
def update_properties(self):
|
||||
"""Callback on data changes for node values."""
|
||||
def update(self):
|
||||
"""Get the current state of the entity."""
|
||||
# Position value
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL).values():
|
||||
|
|
|
@ -108,7 +108,7 @@ class ZwaveDimmer(zwave.ZWaveDeviceEntity, Light):
|
|||
_LOGGER.debug("AEOTEC ZW098 workaround enabled")
|
||||
self._zw098 = 1
|
||||
|
||||
self.update_properties()
|
||||
self.update()
|
||||
|
||||
# Used for value change event handling
|
||||
self._refreshing = False
|
||||
|
@ -116,7 +116,7 @@ class ZwaveDimmer(zwave.ZWaveDeviceEntity, Light):
|
|||
_LOGGER.debug('self._refreshing=%s self.delay=%s',
|
||||
self._refresh_value, self._delay)
|
||||
|
||||
def update_properties(self):
|
||||
def update(self):
|
||||
"""Update internal properties based on zwave values."""
|
||||
# Brightness
|
||||
self._brightness, self._state = brightness_state(self._value)
|
||||
|
@ -126,7 +126,7 @@ class ZwaveDimmer(zwave.ZWaveDeviceEntity, Light):
|
|||
if self._refresh_value:
|
||||
if self._refreshing:
|
||||
self._refreshing = False
|
||||
self.update_properties()
|
||||
self.schedule_update_ha_state(True)
|
||||
else:
|
||||
def _refresh_value():
|
||||
"""Used timer callback for delayed value refresh."""
|
||||
|
@ -138,10 +138,9 @@ class ZwaveDimmer(zwave.ZWaveDeviceEntity, Light):
|
|||
|
||||
self._timer = Timer(self._delay, _refresh_value)
|
||||
self._timer.start()
|
||||
self.schedule_update_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
else:
|
||||
self.update_properties()
|
||||
self.schedule_update_ha_state()
|
||||
self.schedule_update_ha_state(True)
|
||||
|
||||
@property
|
||||
def brightness(self):
|
||||
|
@ -227,7 +226,7 @@ class ZwaveColorLight(ZwaveDimmer):
|
|||
_LOGGER.debug("Zwave node color values found.")
|
||||
dispatcher.disconnect(
|
||||
self._value_added, ZWaveNetwork.SIGNAL_VALUE_ADDED)
|
||||
self.update_properties()
|
||||
self.update()
|
||||
|
||||
def _value_added(self, value):
|
||||
"""Called when a value has been added to the network."""
|
||||
|
@ -236,9 +235,9 @@ class ZwaveColorLight(ZwaveDimmer):
|
|||
# Check for the missing color values
|
||||
self._get_color_values()
|
||||
|
||||
def update_properties(self):
|
||||
def update(self):
|
||||
"""Update internal properties based on zwave values."""
|
||||
super().update_properties()
|
||||
super().update()
|
||||
|
||||
if self._value_color is None:
|
||||
return
|
||||
|
|
|
@ -112,10 +112,10 @@ class ZwaveLock(zwave.ZWaveDeviceEntity, LockDevice):
|
|||
self._state = None
|
||||
self._notification = None
|
||||
self._lock_status = None
|
||||
self.update_properties()
|
||||
self.update()
|
||||
|
||||
def update_properties(self):
|
||||
"""Callback on data changes for node values."""
|
||||
def update(self):
|
||||
"""Get the current state of the entity."""
|
||||
for value in self._node.get_values(
|
||||
class_id=zwave.const.COMMAND_CLASS_ALARM).values():
|
||||
if value.label != "Access Control":
|
||||
|
|
|
@ -624,12 +624,7 @@ class ZWaveDeviceEntity(Entity):
|
|||
|
||||
def value_changed(self, value):
|
||||
"""Called when a value for this entity's node has changed."""
|
||||
self.update_properties()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
def update_properties(self):
|
||||
"""Callback on data changes for node values."""
|
||||
pass
|
||||
self.schedule_update_ha_state(True)
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue