Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
indigo-jay committed Feb 14, 2022
2 parents d747023 + e9f9c04 commit ae36f0e
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 185 deletions.
6 changes: 3 additions & 3 deletions Example Custom Broadcaster.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>2021.1.0</string>
<string>2022.1.0</string>
<key>ServerApiVersion</key>
<string>2.5</string>
<string>3.0</string>
<key>IwsApiVersion</key>
<string>1.0.0</string>
<key>CFBundleDisplayName</key>
Expand All @@ -18,7 +18,7 @@
<array>
<dict>
<key>CFBundleURLName</key>
<string>http://wiki.indigodomo.com/doku.php?id=plugins:example_custom_broadcaster_1</string>
<string>https://wiki.indigodomo.com/doku.php?id=plugins:example_custom_broadcaster_1</string>
</dict>
</array>
</dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
####################
# Copyright (c) 2016, Perceptive Automation, LLC. All rights reserved.
# Copyright (c) 2022, Perceptive Automation, LLC. All rights reserved.
# http://www.indigodomo.com

import indigo

import os
import sys
import random

# Note the "indigo" module is automatically imported and made available inside
Expand All @@ -22,14 +20,14 @@ def __init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs):

########################################
def startup(self):
self.debugLog(u"startup called -- broadcasting startup to all subscribers")
self.logger.debug("startup called -- broadcasting startup to all subscribers")
# Broadcast to all listeners that we have started using the "broadcasterStarted"
# broadcast key. Note the key is arbitrary and will just be used by the
# subscribers in their subscribeToBroadcast() call.
indigo.server.broadcastToSubscribers(u"broadcasterStarted")
indigo.server.broadcastToSubscribers("broadcasterStarted")

def shutdown(self):
self.debugLog(u"shutdown called -- broadcasting shutdown to all subscribers")
self.logger.debug("shutdown called -- broadcasting shutdown to all subscribers")
# Broadcast to all listeners that we have shutdown using the "broadcasterShutdown"
# broadcast key.
indigo.server.broadcastToSubscribers(u"broadcasterShutdown")
Expand All @@ -46,7 +44,7 @@ def runConcurrentThread(self):
# boolean, dict, or list. For server performance please keep the data size
# sent small (a few kilobytes at most), and try not to broadcast more frequently
# than once per second. Bursts of higher data rates should be fine.
indigo.server.broadcastToSubscribers(u"colorChanged", color)
indigo.server.broadcastToSubscribers("colorChanged", color)
self.sleep(3)
except self.StopThread:
pass # Optionally catch the StopThread exception and do any needed cleanup.
pass # Optionally catch the StopThread exception and do any needed cleanup.
6 changes: 3 additions & 3 deletions Example Custom Subscriber.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>2021.1.0</string>
<string>2022.1.0</string>
<key>ServerApiVersion</key>
<string>2.5</string>
<string>3.0</string>
<key>IwsApiVersion</key>
<string>1.0.0</string>
<key>CFBundleDisplayName</key>
Expand All @@ -18,7 +18,7 @@
<array>
<dict>
<key>CFBundleURLName</key>
<string>http://wiki.indigodomo.com/doku.php?id=plugins:example_custom_subscriber_1</string>
<string>https://wiki.indigodomo.com/doku.php?id=plugins:example_custom_subscriber_1</string>
</dict>
</array>
</dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
####################
# Copyright (c) 2016, Perceptive Automation, LLC. All rights reserved.
# Copyright (c) 2022, Perceptive Automation, LLC. All rights reserved.
# http://www.indigodomo.com

import indigo

import os
import sys
import random

# Note the "indigo" module is automatically imported and made available inside
# our global name space by the host process.

Expand All @@ -25,25 +21,25 @@ def __init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs):

########################################
def startup(self):
self.debugLog(u"startup called -- subscribing to messages from Example Custom Broadcaster plugin")
self.debugLog("startup called -- subscribing to messages from Example Custom Broadcaster plugin")
# The Example Custom Broadcaster plugin defines three broadcast keys: broadcasterStarted,
# broadcasterShutdown, and colorChanged. We subscribe to notifications of all three. The
# second argument is the broadcast key used by the broadcasting plugin, the third argument
# is the name of our callback method. In this case they are the same, but they don't have
# to be.
indigo.server.subscribeToBroadcast(kBroadcasterPluginId, u"broadcasterStarted", u"broadcasterStarted")
indigo.server.subscribeToBroadcast(kBroadcasterPluginId, u"broadcasterShutdown", u"broadcasterShutdown")
indigo.server.subscribeToBroadcast(kBroadcasterPluginId, u"colorChanged", u"colorChanged")
indigo.server.subscribeToBroadcast(kBroadcasterPluginId, "broadcasterStarted", "broadcasterStarted")
indigo.server.subscribeToBroadcast(kBroadcasterPluginId, "broadcasterShutdown", "broadcasterShutdown")
indigo.server.subscribeToBroadcast(kBroadcasterPluginId, "colorChanged", "colorChanged")

def shutdown(self):
self.debugLog(u"shutdown called")
self.logger.debug("shutdown called")

########################################
def broadcasterStarted(self):
self.logger.info(u"received broadcasterStarted message")
self.logger.info("received broadcasterStarted message")

def broadcasterShutdown(self):
self.logger.info(u"received broadcasterShutdown message")
self.logger.info("received broadcasterShutdown message")

def colorChanged(self, arg):
self.logger.info(u"received colorChanged message: %s" % (arg))
self.logger.info(f"received colorChanged message: {arg}")
6 changes: 3 additions & 3 deletions Example Database Traverse.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>2021.1.0</string>
<string>2022.1.0</string>
<key>ServerApiVersion</key>
<string>2.5</string>
<string>3.0</string>
<key>IwsApiVersion</key>
<string>1.0.0</string>
<key>CFBundleDisplayName</key>
Expand All @@ -18,7 +18,7 @@
<array>
<dict>
<key>CFBundleURLName</key>
<string>http://wiki.indigodomo.com/doku.php?id=plugins:example_db_traverse_1</string>
<string>https://wiki.indigodomo.com/doku.php?id=plugins:example_db_traverse_1</string>
</dict>
</array>
</dict>
Expand Down
Loading

0 comments on commit ae36f0e

Please sign in to comment.