mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-01-27 10:24:19 +01:00
Instantiate FHEM object only in case of valid typ
This commit is contained in:
parent
9fb4e5fbe9
commit
f18e47334e
|
|
@ -89,8 +89,6 @@ def run(typ,freq,data):
|
|||
logging.debug("password: %s", password)
|
||||
|
||||
########## User Plugin CODE ##########
|
||||
fh = fhem.Fhem(server=server, protocol=protocol, port=port, username=username, password=password)
|
||||
|
||||
if typ == "FMS":
|
||||
fhemCommand = globalVars.config.get("fhemCmd", "commandFMS")
|
||||
elif typ == "ZVEI":
|
||||
|
|
@ -104,6 +102,8 @@ def run(typ,freq,data):
|
|||
fhemCommand = wildcardHandler.replaceWildcards(fhemCommand, data)
|
||||
logging.debug("fhemCommand: %s", fhemCommand)
|
||||
|
||||
fh = fhem.Fhem(server=server, protocol=protocol, port=port, username=username, password=password)
|
||||
|
||||
fh.send_cmd(fhemCommand)
|
||||
del fh
|
||||
########## User Plugin CODE ##########
|
||||
|
|
|
|||
Loading…
Reference in a new issue