-
-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exit when command_classes are missing thermostat Zwave #2824
Conversation
5fa1dc3
to
80d4ac4
Compare
@@ -52,6 +52,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None): | |||
_LOGGER.debug("Remotec ZXT-120 Zwave Thermostat, ignoring") | |||
return | |||
|
|||
if value.command_class != COMMAND_CLASS_SENSOR_MULTILEVEL and \ | |||
value.command_class != COMMAND_CLASS_THERMOSTAT_SETPOINT: | |||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, now you're checking if 1 value is equal to 2 different values. I'm assuming those 2 values are not the same so this test will always be false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, This is inverted logic. We use the same here:
https://github.com/turbokongen/home-assistant/blob/zwave_fixes/homeassistant/components/garage_door/zwave.py#L28
Or maybe this is or we need? 😕
I see. We need to test each individual not together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see I need to figure out a different method to do this. Because we pass in only one command_class to begin with.
40e90fa
to
bbb125d
Compare
@@ -51,6 +51,11 @@ def setup_platform(hass, config, add_devices, discovery_info=None): | |||
if DEVICE_MAPPINGS[specific_sensor_key] == WORKAROUND_IGNORE: | |||
_LOGGER.debug("Remotec ZXT-120 Zwave Thermostat, ignoring") | |||
return | |||
if not (value.node.get_values_for_command_class( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An empty dict is already falsey while a dict with any info in it is true. So no need to call items()
on it.
› python3
Python 3.4.3 (default, Aug 11 2015, 08:57:25)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> bool({})
False
>>> bool({'hello': 1})
True
bbb125d
to
525598e
Compare
Description:
Make sure essential values are present. Exit if not.
#2820