onNotification interface change

Python and python framework

Moderator: leecollings

Post Reply
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

onNotification interface change

Post by Dnpwwo »

I've completed work on sending notifications through to plugins so that they can handle them if they want to in the next beta.

Although no plugins are using it yet, some do have an 'onNotification' function defined that could not get an error like:

Code: Select all

 2017-02-16 21:03:12.040 Error: (Test Kodi) 'onNotification' failed 'TypeError':'onNotification() takes 1 positional argument but 7 were given'.
because I had to change the interface.

The plugins will still work as before, but to remove the error simply remove the old onNotification call back from the plugin or change the definition to be:

Code: Select all

def onNotification(Name, Subject, Text, Status, Priority, Sound, ImageFile):
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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest