forked from platypush/platypush
Made _is_switch more resilient against rogue Z-Wave values
This commit is contained in:
parent
117f92e5b4
commit
f57f940d57
1 changed files with 3 additions and 1 deletions
|
@ -462,7 +462,9 @@ class ZwaveMqttPlugin(MqttPlugin, ZwaveBasePlugin):
|
|||
|
||||
@staticmethod
|
||||
def _is_switch(value: Mapping):
|
||||
return value.get('command_class_name', '').endswith('Switch')
|
||||
return (
|
||||
value.get('command_class_name', '').endswith('Switch') if value else False
|
||||
)
|
||||
|
||||
def transform_entities(self, values: Iterable[Mapping]):
|
||||
entities = []
|
||||
|
|
Loading…
Reference in a new issue