Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
####################
# Copyright (c) 2024, Indigo Domotics. All rights reserved.
# Copyright (c) 2026, Indigo Domotics. All rights reserved.
# https://www.indigodomo.com
try:
# This is primarily for IDEs - the indigo package is always included when a plugin is started.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
####################
# Copyright (c) 2024, Indigo Domotics. All rights reserved.
# Copyright (c) 2026, Indigo Domotics. All rights reserved.
# https://www.indigodomo.com
try:
# This is primarily for IDEs - the indigo package is always included when a plugin is started.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
####################
# Copyright (c) 2024, Indigo Domotics. All rights reserved.
# Copyright (c) 2026, Indigo Domotics. All rights reserved.
# https://www.indigodomo.com
try:
# This is primarily for IDEs - the indigo package is always included when a plugin is started.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
####################
# Copyright (c) 2024, Indigo Domotics. All rights reserved.
# Copyright (c) 2026, Indigo Domotics. All rights reserved.
# https://www.indigodomo.com
try:
# This is primarily for IDEs - the indigo package is always included when a plugin is started.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
####################
# Copyright (c) 2024, Indigo Domotics. All rights reserved.
# Copyright (c) 2026, Indigo Domotics. All rights reserved.
# https://www.indigodomo.com
try:
# This is primarily for IDEs - the indigo package is always included when a plugin is started.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>2024.2.0</string>
<string>2025.2.0</string>
<key>ServerApiVersion</key>
<string>3.6</string>
<key>CFBundleDisplayName</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<!-- If your plugin wants to add menu items to its submenu off the new Extensions menu,
define them here. Each should have a unique menu id, a Name, and an Action. The last
is a method name in your python file that will be called when the user selects that
menu item. Note - nothing will be returned to the client, so if you need to communicate
back to the user you can post information into the Event Log.
-->
<MenuItems>
<MenuItem id="menu1">
<Name>Toggle Automatic State Updates</Name>
<CallbackMethod>toggle_automatic_updates</CallbackMethod>
</MenuItem>
</MenuItems>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
####################
# Copyright (c) 2024, Perceptive Automation, LLC. All rights reserved.
# Copyright (c) 2026, Perceptive Automation, LLC. All rights reserved.
# https://www.indigodomo.com

import random
Expand All @@ -25,6 +25,7 @@ def __init__(
) -> None:
super().__init__(plugin_id, plugin_display_name, plugin_version, plugin_prefs)
self.debug: bool = True
self.automatic_updates = True # Enable/disable automatic device updates

########################################
def startup(self: indigo.PluginBase) -> None:
Expand Down Expand Up @@ -72,13 +73,14 @@ def _refresh_states_from_hardware(
def runConcurrentThread(self: indigo.PluginBase):
try:
while True:
for dev in indigo.devices.iter("self"):
if not dev.enabled or not dev.configured:
continue
# Plugins that need to poll out the status from the meter
# could do so here, then broadcast back the new values to the
# Indigo Server.
self._refresh_states_from_hardware(dev, False)
if self.automatic_updates:
for dev in indigo.devices.iter("self"):
if not dev.enabled or not dev.configured:
continue
# Plugins that need to poll out the status from the meter
# could do so here, then broadcast back the new values to the
# Indigo Server.
self._refresh_states_from_hardware(dev, False)
self.sleep(2)
except self.StopThread:
pass # Optionally catch the StopThread exception and do any needed cleanup.
Expand Down Expand Up @@ -180,3 +182,10 @@ def set_backlight_brightness(self: indigo.PluginBase, plugin_action, dev):
else:
# Else log failure but do NOT update state on Indigo Server.
self.logger.error(f"send \"{dev.name}\" set backlight brightness to {new_brightness} failed")

########################################
# Menu items
######################
def toggle_automatic_updates(self):
# toggles a global variable to enable/disable continuous state updates for all devices.
self.automatic_updates = not self.automatic_updates
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
####################
# Copyright (c) 2024, Indigo Domotics. All rights reserved.
# Copyright (c) 2026, Indigo Domotics. All rights reserved.
# https://www.indigodomo.com
try:
# This is primarily for IDEs - the indigo package is always included when a plugin is started.
Expand Down
23 changes: 0 additions & 23 deletions Example Device - Relay and Dimmer.indigoPlugin/Contents/Info.plist

This file was deleted.

This file was deleted.

This file was deleted.

Loading