Der Name sagts schon ...
Ankündigung
Einklappen
Keine Ankündigung bisher.
Support Thread zum Prowl Plugin
Einklappen
X
-
Hi,
komisch, dass hier noch niemand geschrieben hat, oder vielleicht mach' ich mal wieder was falsch.
Habe das Plugin aktiviert und einen API Key eigegeben.
Wenn ich die Funktion sh.notify(...) aufrufen möchte, gibt es diese jedoch nicht uns es erscheint folgende Fehlermeldung:
Code:2021-01-08 21:08:39 ERROR logics.test Logic: logics.test, File: /usr/local/smarthome/plugins/prowl/__init__.py, Line: 65, Method: notify, Exception: __call__() takes from 1 to 7 positional arguments but 8 were given > Traceback (most recent call last): > File "/usr/local/smarthome/lib/scheduler.py", line 590, in _task > exec(obj.bytecode) > File "/usr/local/smarthome/logics/test.py", line 5, in <module> > sh.notify('Intrusion', 'Living room window broken') > File "/usr/local/smarthome/plugins/prowl/__init__.py", line 65, in notify > self.__call__(self, event, description, priority, url, apikey, application) > TypeError: __call__() takes from 1 to 7 positional arguments but 8 were given
Code:#!/usr/bin/env python3 # test.py #sh.Prowl.notify(event:str= '', description:str= '', priority:int=None*, url:str=None, apikey:str=None, application:str= 'SmartHomeNG') sh.notify('Intrusion', 'Living room window broken')
Meine plugin.yaml sieht wie folgt aus (auch völlig unspektakulär):
Code:Prowl: plugin_name: prowl apikey: xxx
In der Anwenderdoku konnte ich leider nichts finden.
Hat jemand eine Idee, woran das liegt?
Viele Grüße und schon mal Danke,
Chris
-
Wenn du deinen Testcode nutzt: du rufst sh.notify auf, was auch immer das für eine Funktion ist. Im auskommentierten Beispiel steht doch, wie es aufgerufen wird: sh.Prowl.notify(...), wenn dein Plugin in der plugin.yaml "Prowl" heißt.
Wenn ich deine Konfig so ansehe, müsstest du also
sh.prowl.notify(...)
aufrufen
Kommentar
-
Das hatte ich auch schon probiert und erhalte dann folgende Fehlermeldung:
Code:2021-01-09 10:29:30 ERROR logics.test Logic: logics.test, File: /usr/local/smarthome/plugins/prowl/__init__.py, Line: 65, Method: notify, Exception: __call__() takes from 1 to 7 positional arguments but 8 were given > Traceback (most recent call last): > File "/usr/local/smarthome/lib/scheduler.py", line 590, in _task > exec(obj.bytecode) > File "/usr/local/smarthome/logics/test.py", line 5, in <module> > sh.Prowl.notify('Intrusion', 'Living room window broken') > File "/usr/local/smarthome/plugins/prowl/__init__.py", line 65, in notify > self.__call__(self, event, description, priority, url, apikey, application) > TypeError: __call__() takes from 1 to 7 positional arguments but 8 were given
Das möchte ich heute mal testen.
Vielen Dank für die RM und Grüße
Chris
Kommentar
Kommentar