Compare commits

...

8 Commits

Author SHA1 Message Date
Paulus Schoutsen 395a8663b5 Merge pull request #1446 from balloob/hotfix/0.14.2
Hotfix/0.14.2
2016-02-29 08:22:26 -08:00
Paulus Schoutsen f9eb62dd9e Version bump to 0.14.2 2016-02-29 08:10:52 -08:00
Stefan Jonasson c6a6eaee9f Fixed the z-wave sensor workarounds for empty manufacturer ids 2016-02-29 08:10:26 -08:00
Paulus Schoutsen e246c83b0e Version bump to 0.14.1 2016-02-28 09:27:52 -08:00
Paulus Schoutsen 3f4e34727d Merge pull request #1428 from balloob/hotfix/0.14.1
Hotfix/0.14.1
2016-02-28 09:26:36 -08:00
Dan Smith 34b463f435 Gracefully handle having no wemo config section
I broke this with my fix, where I assumed that we'd always have a wemo
config section if we're running the wemo code. However, if we're fully
auto-detected, we might not.
2016-02-28 09:18:23 -08:00
Dan Smith 3790764df9 Fix wemo known device tracking
The wemo component was tracking devices by mac to avoid adding duplicates,
but this means we'd never be able to load more than one static wemo, since
they all have mac=None.

This changes the code to track by url, which has to be unique per wemo
anyway, and which we also have for even static wemos.
2016-02-27 21:03:45 -08:00
Dan Smith da2bcb3f27 Fix static configured wemo devices
The new wemo code was pulling 'static' from the global config instead of
the wemo component config.
2016-02-27 21:03:40 -08:00
4 changed files with 35 additions and 27 deletions
+18 -14
View File
@@ -39,22 +39,26 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
node = NETWORK.nodes[discovery_info[ATTR_NODE_ID]]
value = node.values[discovery_info[ATTR_VALUE_ID]]
specific_sensor_key = (int(value.node.manufacturer_id, 16),
int(value.node.product_id, 16),
value.index)
value.set_change_verified(False)
if specific_sensor_key in DEVICE_MAPPINGS:
if DEVICE_MAPPINGS[specific_sensor_key] == WORKAROUND_NO_OFF_EVENT:
# Default the multiplier to 4
re_arm_multiplier = (get_config_value(value.node, 9) or 4)
add_devices([
ZWaveTriggerSensor(value, "motion",
hass, re_arm_multiplier * 8)
])
elif value.command_class == COMMAND_CLASS_SENSOR_BINARY:
# 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()):
specific_sensor_key = (int(value.node.manufacturer_id, 16),
int(value.node.product_id, 16),
value.index)
if specific_sensor_key in DEVICE_MAPPINGS:
if DEVICE_MAPPINGS[specific_sensor_key] == WORKAROUND_NO_OFF_EVENT:
# Default the multiplier to 4
re_arm_multiplier = (get_config_value(value.node, 9) or 4)
add_devices([
ZWaveTriggerSensor(value, "motion",
hass, re_arm_multiplier * 8)
])
return
if value.command_class == COMMAND_CLASS_SENSOR_BINARY:
add_devices([ZWaveBinarySensor(value, None)])
+11 -8
View File
@@ -50,17 +50,20 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
# groups[1].associations):
# node.groups[1].add_association(NETWORK.controller.node_id)
specific_sensor_key = (int(value.node.manufacturer_id, 16),
int(value.node.product_id, 16),
value.index)
# 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()):
specific_sensor_key = (int(value.node.manufacturer_id, 16),
int(value.node.product_id, 16),
value.index)
# Check workaround mappings for specific devices.
if specific_sensor_key in DEVICE_MAPPINGS:
if DEVICE_MAPPINGS[specific_sensor_key] == WORKAROUND_IGNORE:
return
# Check workaround mappings for specific devices.
if specific_sensor_key in DEVICE_MAPPINGS:
if DEVICE_MAPPINGS[specific_sensor_key] == WORKAROUND_IGNORE:
return
# Generic Device mappings
elif value.command_class == COMMAND_CLASS_SENSOR_MULTILEVEL:
if value.command_class == COMMAND_CLASS_SENSOR_MULTILEVEL:
add_devices([ZWaveMultilevelSensor(value)])
elif (value.command_class == COMMAND_CLASS_METER and
+5 -4
View File
@@ -58,12 +58,12 @@ def setup(hass, config):
def discovery_dispatch(service, discovery_info):
"""Dispatcher for WeMo discovery events."""
# name, model, location, mac
_, model_name, _, mac = discovery_info
_, model_name, url, _ = discovery_info
# Only register a device once
if mac in KNOWN_DEVICES:
if url in KNOWN_DEVICES:
return
KNOWN_DEVICES.append(mac)
KNOWN_DEVICES.append(url)
service = WEMO_MODEL_DISPATCH.get(model_name) or DISCOVER_SWITCHES
component = WEMO_SERVICE_DISPATCH.get(service)
@@ -77,7 +77,8 @@ def setup(hass, config):
devices = [(device.host, device) for device in pywemo.discover_devices()]
# Add static devices from the config file
devices.extend((address, None) for address in config.get('static', []))
devices.extend((address, None)
for address in config.get(DOMAIN, {}).get('static', []))
for address, device in devices:
port = pywemo.ouimeaux_device.probe_wemo(address)
+1 -1
View File
@@ -1,7 +1,7 @@
# coding: utf-8
"""Constants used by Home Assistant components."""
__version__ = "0.14.0"
__version__ = "0.14.2"
# Can be used to specify a catch all when registering state or event listeners.
MATCH_ALL = '*'