mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Some zwave cleanup (#6203)
This commit is contained in:
parent
9f04b55572
commit
b27ba9660b
@ -21,8 +21,6 @@ DEPENDENCIES = []
|
||||
|
||||
def get_device(value, **kwargs):
|
||||
"""Create zwave entity device."""
|
||||
value.set_change_verified(False)
|
||||
|
||||
device_mapping = workaround.get_device_mapping(value)
|
||||
if device_mapping == workaround.WORKAROUND_NO_OFF_EVENT:
|
||||
# Default the multiplier to 4
|
||||
|
@ -36,7 +36,6 @@ DEVICE_MAPPINGS = {
|
||||
def get_device(hass, value, **kwargs):
|
||||
"""Create zwave entity device."""
|
||||
temp_unit = hass.config.units.temperature_unit
|
||||
value.set_change_verified(False)
|
||||
return ZWaveClimate(value, temp_unit)
|
||||
|
||||
|
||||
|
@ -24,14 +24,9 @@ def get_device(value, **kwargs):
|
||||
"""Create zwave entity device."""
|
||||
if (value.command_class == zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL
|
||||
and value.index == 0):
|
||||
value.set_change_verified(False)
|
||||
return ZwaveRollershutter(value)
|
||||
elif (value.command_class == zwave.const.COMMAND_CLASS_SWITCH_BINARY or
|
||||
value.command_class == zwave.const.COMMAND_CLASS_BARRIER_OPERATOR):
|
||||
if (value.type != zwave.const.TYPE_BOOL and
|
||||
value.genre != zwave.const.GENRE_USER):
|
||||
return None
|
||||
value.set_change_verified(False)
|
||||
return ZwaveGarageDoor(value)
|
||||
return None
|
||||
|
||||
|
@ -57,14 +57,6 @@ def get_device(node, value, node_config, **kwargs):
|
||||
_LOGGER.debug('name=%s node_config=%s CONF_REFRESH_VALUE=%s'
|
||||
' CONF_REFRESH_DELAY=%s', name, node_config,
|
||||
refresh, delay)
|
||||
if value.command_class != zwave.const.COMMAND_CLASS_SWITCH_MULTILEVEL:
|
||||
return None
|
||||
if value.type != zwave.const.TYPE_BYTE:
|
||||
return None
|
||||
if value.genre != zwave.const.GENRE_USER:
|
||||
return None
|
||||
|
||||
value.set_change_verified(False)
|
||||
|
||||
if node.has_command_class(zwave.const.COMMAND_CLASS_SWITCH_COLOR):
|
||||
return ZwaveColorLight(value, refresh, delay)
|
||||
|
@ -175,12 +175,6 @@ def get_device(hass, node, value, **kwargs):
|
||||
_LOGGER.info('Usercode at slot %s is cleared', value.index)
|
||||
break
|
||||
|
||||
if value.command_class != zwave.const.COMMAND_CLASS_DOOR_LOCK:
|
||||
return None
|
||||
if value.type != zwave.const.TYPE_BOOL:
|
||||
return None
|
||||
if value.genre != zwave.const.GENRE_USER:
|
||||
return None
|
||||
if node.has_command_class(zwave.const.COMMAND_CLASS_USER_CODE):
|
||||
hass.services.register(DOMAIN,
|
||||
SERVICE_SET_USERCODE,
|
||||
@ -197,7 +191,6 @@ def get_device(hass, node, value, **kwargs):
|
||||
clear_usercode,
|
||||
descriptions.get(SERVICE_CLEAR_USERCODE),
|
||||
schema=CLEAR_USERCODE_SCHEMA)
|
||||
value.set_change_verified(False)
|
||||
return ZwaveLock(value)
|
||||
|
||||
|
||||
|
@ -17,8 +17,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
def get_device(node, value, **kwargs):
|
||||
"""Create zwave entity device."""
|
||||
value.set_change_verified(False)
|
||||
|
||||
# Generic Device mappings
|
||||
if node.has_command_class(zwave.const.COMMAND_CLASS_SENSOR_MULTILEVEL):
|
||||
return ZWaveMultilevelSensor(value)
|
||||
|
@ -14,15 +14,8 @@ from homeassistant.components.zwave import async_setup_platform # noqa # pylint
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def get_device(node, value, **kwargs):
|
||||
def get_device(value, **kwargs):
|
||||
"""Create zwave entity device."""
|
||||
if not node.has_command_class(zwave.const.COMMAND_CLASS_SWITCH_BINARY):
|
||||
return None
|
||||
if value.type != zwave.const.TYPE_BOOL or value.genre != \
|
||||
zwave.const.GENRE_USER:
|
||||
return None
|
||||
value.set_change_verified(False)
|
||||
return ZwaveSwitch(value)
|
||||
|
||||
|
||||
|
@ -706,6 +706,7 @@ class ZWaveDeviceEntity(Entity):
|
||||
from openzwave.network import ZWaveNetwork
|
||||
from pydispatch import dispatcher
|
||||
self._value = value
|
||||
self._value.set_change_verified(False)
|
||||
self.entity_id = "{}.{}".format(domain, self._object_id())
|
||||
self._update_attributes()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user