forked from platypush/platypush
OZW objects should be imported inside of the ZwavePlugin
class to prevent ImportError
on other Z-Wave plugins that don't depend on OZW
This commit is contained in:
parent
02a22d4a88
commit
68c44c0c3c
1 changed files with 6 additions and 5 deletions
|
@ -1,10 +1,5 @@
|
|||
from typing import Any, Dict, Optional, List, Union
|
||||
|
||||
from openzwave.group import ZWaveGroup
|
||||
from openzwave.node import ZWaveNode
|
||||
from openzwave.scene import ZWaveScene
|
||||
from openzwave.value import ZWaveValue
|
||||
|
||||
from platypush.backend.zwave import ZwaveBackend
|
||||
from platypush.context import get_backend
|
||||
from platypush.plugins import action
|
||||
|
@ -24,6 +19,11 @@ class ZwavePlugin(ZwaveBasePlugin, SwitchPlugin):
|
|||
|
||||
"""
|
||||
|
||||
from openzwave.group import ZWaveGroup
|
||||
from openzwave.node import ZWaveNode
|
||||
from openzwave.scene import ZWaveScene
|
||||
from openzwave.value import ZWaveValue
|
||||
|
||||
@staticmethod
|
||||
def _get_backend() -> ZwaveBackend:
|
||||
backend = get_backend('zwave')
|
||||
|
@ -507,6 +507,7 @@ class ZwavePlugin(ZwaveBasePlugin, SwitchPlugin):
|
|||
:param node_id: Select value by [node_id/node_name, value_label]
|
||||
:param node_name: Select value by [node_id/node_name, value_label]
|
||||
"""
|
||||
from openzwave.node import ZWaveNode
|
||||
value = self._get_value(value_id=value_id, id_on_network=id_on_network,
|
||||
node_id=node_id, node_name=node_name, value_label=value_label)
|
||||
new_val = value.check_data(data)
|
||||
|
|
Loading…
Reference in a new issue