Bugfix: Zwave set_config_parameter failed when config list contained int (#13301)

* Cast list and bool options to STR

* Add button options to STR

* Add TYPE_BUTTON to value types

* Adjust comparison

* Remove Logging

* Remove Empty line

* Update tests

* Update tests

* Mistake
This commit is contained in:
John Arild Berentsen authored and GitHub committed 2018-03-20 14:04:24 +01:00
1 parent 3fa080a795
commit 5c4529d044
3 files changed
+44 -4

No files matched your search

+10 -3
View File
@@ -442,9 +442,16 @@ def setup(hass, config):
if value.index != param:
continue
if value.type in [const.TYPE_LIST, const.TYPE_BOOL]:
value.data = selection
_LOGGER.info("Setting config list parameter %s on Node %s "
"with selection %s", param, node_id,
value.data = str(selection)
_LOGGER.info("Setting config parameter %s on Node %s "
"with list/bool selection %s", param, node_id,
str(selection))
return
if value.type == const.TYPE_BUTTON:
network.manager.pressButton(value.value_id)
network.manager.releaseButton(value.value_id)
_LOGGER.info("Setting config parameter %s on Node %s "
"with button selection %s", param, node_id,
selection)
return
value.data = int(selection)
+1
View File
@@ -327,6 +327,7 @@ TYPE_DECIMAL = "Decimal"
TYPE_INT = "Int"
TYPE_LIST = "List"
TYPE_STRING = "String"
TYPE_BUTTON = "Button"
DISC_COMMAND_CLASS = "command_class"
DISC_COMPONENT = "component"