-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTPCLIENT.py
More file actions
17 lines (15 loc) · 720 Bytes
/
TPCLIENT.py
File metadata and controls
17 lines (15 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# TPCLIENT
import TouchPortalAPI as TP
from tp_entry import PLUGIN_ID, __version__
import sys
try:
TPClient = TP.Client(
pluginId = PLUGIN_ID, # required ID of this plugin
sleepPeriod = 0.05, # allow more time than default for other processes
autoClose = True, # automatically disconnect when TP sends "closePlugin" message
checkPluginId = True, # validate destination of messages sent to this plugin
maxWorkers = 4, # run up to 4 event handler threads
updateStatesOnBroadcast = False, # do not spam TP with state updates on every page change
)
except Exception as e:
sys.exit(f"Could not create TP Client, exiting. Error was:\n{repr(e)}")