Skip to content

Commit 5e15d56

Browse files
committed
Updates for Indigo 2023.2
1 parent 44fddd1 commit 5e15d56

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

ratgdo.indigoPlugin/Contents/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<plist version="1.0">
44
<dict>
55
<key>PluginVersion</key>
6-
<string>2023.0.0</string>
6+
<string>2023.2.0</string>
77
<key>ServerApiVersion</key>
8-
<string>3.0</string>
8+
<string>3.4</string>
99
<key>IwsApiVersion</key>
1010
<string>1.0.0</string>
1111
<key>CFBundleName</key>

ratgdo.indigoPlugin/Contents/Server Plugin/plugin.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ def __init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs):
2323

2424
self.ratgdo_devices = []
2525
self.mqttPlugin = indigo.server.getPlugin("com.flyingdiver.indigoplugin.mqtt")
26-
if not self.mqttPlugin.isEnabled():
27-
self.logger.warning("MQTT Connector plugin not enabled!")
2826

2927
if old_version := self.pluginPrefs.get("version", "0.0.0") != self.pluginVersion:
3028
self.logger.debug(f"Upgrading plugin from version {old_version} to {self.pluginVersion}")
3129
self.pluginPrefs["version"] = self.pluginVersion
3230

3331
def startup(self):
3432
self.logger.info("Starting ratgdo")
33+
34+
if not self.mqttPlugin.isEnabled():
35+
return "MQTT Connector plugin not enabled!"
36+
3537
indigo.server.subscribeToBroadcast("com.flyingdiver.indigoplugin.mqtt", "com.flyingdiver.indigoplugin.mqtt-message_queued", "message_handler")
3638

3739
def message_handler(self, notification):
@@ -144,9 +146,15 @@ def actionControlDevice(self, action, device):
144146
self.logger.debug(f"actionControlDevice: Lock {device.name}")
145147
self.publish_topic(device, f"ratgdo/{device.address}/command/door", "close")
146148

149+
elif action.deviceAction == indigo.kUniversalAction.RequestStatus:
150+
self.logger.debug(f"{device.name}: actionControlUniversal: RequestStatus")
151+
# self.publish_topic(device, f"ratgdo/{device.address}/command", "query")
152+
self.publish_topic(device, f"ratgdo/{device.address}/command/query", "")
153+
147154
else:
148155
self.logger.error(f"{device.name}: actionControlDevice: Unsupported action requested: {action.deviceAction}")
149156

157+
150158
def publish_topic(self, device, topic, payload):
151159

152160
mqttPlugin = indigo.server.getPlugin("com.flyingdiver.indigoplugin.mqtt")

0 commit comments

Comments
 (0)