Zwave: Apply refresh_node workaround on 1st instance only (#7579)

* Apply refresh_node workaround on 1st instance only

* Add another test
This commit is contained in:
Andrey authored and GitHub committed 2017-05-21 17:33:42 +03:00
1 parent 24b7fd3694
commit 927024714b
3 files changed
+25 -4

No files matched your search

+11
View File
@@ -38,3 +38,14 @@ def test_get_device_mapping_mtii():
product_id='0002')
value = MockValue(data=0, node=node, index=0)
assert workaround.get_device_mapping(value) == 'trigger_no_off_event'
def test_get_device_mapping_mti_instance():
"""Test that device mapping mti_instance is returned."""
node = MockNode(manufacturer_id='013c', product_type='0001',
product_id='0005')
value = MockValue(data=0, node=node, instance=1)
assert workaround.get_device_mapping(value) == 'refresh_node_on_update'
value = MockValue(data=0, node=node, instance=2)
assert workaround.get_device_mapping(value) is None