Version: V3.8135 (stable)
Platform: windows
Plugin/Hardware: no hardware,the code down from "https://github.com/domoticz/domoticz/bl ... emplate.py"
Description:
i do not know how to use (or how to active) "onNotification" callbacks function, who can tell me ? i find in Developing_a_Python_plugin.pdf .but is too simple
I Created a virtual hardware which download from "https://github.com/domoticz/domoticz/bl ... emplate.py"
this is my code :
and i've active all Notification system , as matter of fact,my phone is aleady receiving Notification(prowl)
and this is runing debug logs
I mean when i press "switch" button . the onCommand function executioned and loged at history file but。。。 the onNotification no run yet
========================================================================================
i don't know how to post imgs, i used google photo album . pls copy the url at brower sorry
i am chinese. i've studied Domoticz about six months,this is my first time i've asked a question , i hope you can help me thank you !!!
[help]how to use "onNotification" function in python plugin file Topic is solved
Moderator: leecollings
-
- Posts: 5
- Joined: Tuesday 12 June 2018 17:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.9000
- Location: China-Zhejiang
- Contact:
[help]how to use "onNotification" function in python plugin file
只要够努力 时间总会给你想要的
- Dnpwwo
- Posts: 819
- Joined: Sunday 23 March 2014 9:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Melbourne, Australia
- Contact:
Re: [help]how to use "onNotification" function in python plugin file
@jia175891641,
Have a look at the Kodi plugin here: https://github.com/dnpwwo/Domoticz-Kodi ... /plugin.py
There are 2 important bit:
Have a look at the Kodi plugin here: https://github.com/dnpwwo/Domoticz-Kodi ... /plugin.py
There are 2 important bit:
- Line 122: Domoticz.Notifier(Parameters["Mode4"]), this registers the plugin as being able to recieve notifications. Mode4 is a parameter to the plugin that holds the name such as "Kodi-Lounge" or "Kodi-Family" in my case
- Line 488: def onNotification(self, Name, Subject, Text, Status, Priority, Sound, ImageFile): Called when notifications are sent
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
-
- Posts: 5
- Joined: Tuesday 12 June 2018 17:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.9000
- Location: China-Zhejiang
- Contact:
Re: [help]how to use "onNotification" function in python plugin file
i am done !! thank you very much
只要够努力 时间总会给你想要的
Who is online
Users browsing this forum: No registered users and 1 guest