Support for zwave light transitions (#6868)

* Support for zwave light transitions

* Dimming duration is optional

* Updated supported_features to show transition
This commit is contained in:
Adam Mills authored and GitHub committed 2017-04-03 14:56:48 -04:00
1 parent 01e581aced
commit 06e1c21b1f
4 files changed
+132 -27

No files matched your search

@@ -669,6 +669,7 @@ class ZWaveDeviceEntityValues():
continue
self._values[name] = value
if self._entity:
self._entity.value_added()
self._entity.value_changed()
self._check_entity_ready()
@@ -778,6 +779,10 @@ class ZWaveDeviceEntity(ZWaveBaseEntity):
if value.value_id in [v.value_id for v in self.values if v]:
return self.value_changed()
def value_added(self):
"""Called when a new value is added to this entity."""
pass
def value_changed(self):
"""Called when a value for this entity's node has changed."""
self._update_attributes()
@@ -121,6 +121,13 @@ DISCOVERY_SCHEMAS = [
const.DISC_GENRE: const.GENRE_USER,
const.DISC_TYPE: const.TYPE_BYTE,
},
'dimming_duration': {
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_MULTILEVEL],
const.DISC_GENRE: const.GENRE_SYSTEM,
const.DISC_TYPE: const.TYPE_BYTE,
const.DISC_LABEL: 'Dimming Duration',
const.DISC_OPTIONAL: True,
},
'color': {
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_COLOR],
const.DISC_GENRE: const.GENRE_USER,