Skip to content

Commit

Permalink
Merge pull request #6 from gitagogaming/main
Browse files Browse the repository at this point in the history
Fixed Error + New States and Plugin State Update Flow
  • Loading branch information
KillerBOSS2019 authored Nov 3, 2022
2 parents 9a8f548 + 551ebca commit 0e95841
Show file tree
Hide file tree
Showing 4 changed files with 211 additions and 96 deletions.
68 changes: 40 additions & 28 deletions SpeedTest/TPPEntry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from TouchPortalAPI.tppbuild import *

__version__ = 2001
__version__ = 2002
PLUGIN_ID = "com.KillerBOSS.TPPlugins.TPSpeedTest"

TPSDK_DEFAULT_VERSION = 6
Expand Down Expand Up @@ -48,14 +48,22 @@
"id": PLUGIN_ID + ".main",
"name": "Touch Portal SpeedTest",
"imagepath": "%TP_PLUGIN_FOLDER%TPSpeedTest\\icon.png",
},
"download": {
"id": PLUGIN_ID + ".download",
"name": "Download Speed Results"
},
"upload": {
"id": PLUGIN_ID + ".upload",
"name": "Upload Speed Results"
}
}

TP_PLUGIN_ACTIONS = {
"Start speedtest": {
"Start Speedtest": {
"category": "main",
"id": PLUGIN_ID + ".act.startTest",
"name": "Start speedtest",
"name": "Start Speedtest",
"prefix": TP_PLUGIN_CATEGORIES["main"]["name"],
"type": "communicate",
"tryInline": True,
Expand All @@ -75,100 +83,88 @@

TP_PLUGIN_STATES = {
"result Download bits": {
"category": "main",
"category": "download",
"id": PLUGIN_ID + ".st.result.download.bits",
"type": "text",
"desc": "Download speed in (bits)",
"parentGroup": "Download speed result",
"default": "",
},
"result Download bytes": {
"category": "main",
"category": "download",
"id": PLUGIN_ID + ".st.result.download.bytes",
"type": "text",
"desc": "Download speed in (bytes)",
"parentGroup": "Download speed result",
"default": "",
},
"result Download kilobits": {
"category": "main",
"category": "download",
"id": PLUGIN_ID + ".st.result.download.kilobits",
"type": "text",
"desc": "Download speed in (kilobits)",
"parentGroup": "Download speed result",
"default": "",
},
"result Download kilobytes": {
"category": "main",
"category": "download",
"id": PLUGIN_ID + ".st.result.download.kilobytes",
"type": "text",
"desc": "Download speed in (kilobytes)",
"parentGroup": "Download speed result",
"default": "",
},
"result Download megabits": {
"category": "main",
"category": "download",
"id": PLUGIN_ID + ".st.result.download.megabits",
"type": "text",
"desc": "Download speed in (megabits)",
"parentGroup": "Download speed result",
"default": "",
},
"result Download megabytes": {
"category": "main",
"category": "download",
"id": PLUGIN_ID + ".st.result.download.megabytes",
"type": "text",
"desc": "Download speed in (megabytes)",
"parentGroup": "Download speed result",
"default": "",
},

"result Upload bits": {
"category": "main",
"category": "upload",
"id": PLUGIN_ID + ".st.result.upload.bits",
"type": "text",
"desc": "Upload speed in (bits)",
"parentGroup": "Upload speed result",
"default": "",
},
"result Upload bytes": {
"category": "main",
"category": "upload",
"id": PLUGIN_ID + ".st.result.upload.bytes",
"type": "text",
"desc": "Upload speed in (bytes)",
"parentGroup": "Upload speed result",
"default": "",
},
"result Upload kilobits": {
"category": "main",
"category": "upload",
"id": PLUGIN_ID + ".st.result.upload.kilobits",
"type": "text",
"desc": "Upload speed in (kilobits)",
"parentGroup": "Upload speed result",
"default": "",
},
"result Upload kilobytes": {
"category": "main",
"category": "upload",
"id": PLUGIN_ID + ".st.result.upload.kilobytes",
"type": "text",
"desc": "Upload speed in (kilobytes)",
"parentGroup": "Upload speed result",
"default": "",
},
"result Upload megabits": {
"category": "main",
"category": "upload",
"id": PLUGIN_ID + ".st.result.upload.megabits",
"type": "text",
"desc": "Upload speed in (megabits)",
"parentGroup": "Upload speed result",
"default": "",
},
"result Upload megabytes": {
"category": "main",
"category": "upload",
"id": PLUGIN_ID + ".st.result.upload.megabytes",
"type": "text",
"desc": "Upload speed in (megabytes)",
"parentGroup": "Upload speed result",
"default": "",
},

Expand All @@ -195,5 +191,21 @@
"type": "text",
"desc": "Image",
"default": "",
},
"Speed Test Status": {
"category": "main",
"id": PLUGIN_ID + ".st.status",
"name": "Speed Test Status",
"type": "text",
"desc": "Plugin Status",
"default": "",
},
"Speed Test Server": {
"category": "main",
"id": PLUGIN_ID + ".st.server",
"name": "Speed Test Server",
"type": "text",
"desc": "Speed Test Server",
"default": "",
}
}
}
112 changes: 65 additions & 47 deletions SpeedTest/entry.tp
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"sdk": 6,
"version": 2000,
"version": 2002,
"name": "SpeedTest",
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest",
"configuration": {
"colorDark": "#66a3ff",
"colorLight": "#80b3ff"
"colorDark": "#0d162c",
"colorLight": "#4b84f3"
},
"plugin_start_cmd_windows": "%TP_PLUGIN_FOLDER%TouchPortalSpeedTest//SpeedTest.exe",
"plugin_start_cmd_linux": "sh %TP_PLUGIN_FOLDER%TouchPortalSpeedTest//start.sh",
"plugin_start_cmd_mac": "sh %TP_PLUGIN_FOLDER%TouchPortalSpeedTest//start.sh",
"plugin_start_cmd_windows": "%TP_PLUGIN_FOLDER%TPSpeedTest\\TPSpeedtest.exe",
"plugin_start_cmd_linux": "sh %TP_PLUGIN_FOLDER%TPSpeedTest\\start.sh",
"plugin_start_cmd_mac": "sh %TP_PLUGIN_FOLDER%TPSpeedTest\\start.sh",
"categories": [
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.main",
"name": "Touch Portal SpeedTest",
"imagepath": "%TP_PLUGIN_FOLDER%TouchPortalSpeedTest//icon.png",
"imagepath": "%TP_PLUGIN_FOLDER%TPSpeedTest\\icon.png",
"actions": [
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.act.startTest",
Expand All @@ -34,107 +34,125 @@
]
}
],
"states": [
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.ping",
"type": "text",
"desc": "Ping",
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.isp",
"type": "text",
"desc": "ISP",
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.image",
"type": "text",
"desc": "Image",
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.status",
"type": "text",
"desc": "Plugin Status",
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.server",
"type": "text",
"desc": "Speed Test Server",
"default": ""
}
],
"events": [],
"connectors": []
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.download",
"name": "Download Speed Results",
"actions": [],
"states": [
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.download.bits",
"type": "text",
"desc": "Download speed in (bits)",
"parentGroup": "Download speed result",
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.download.bytes",
"type": "text",
"desc": "Download speed in (bytes)",
"parentGroup": "Download speed result",
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.download.kilobits",
"type": "text",
"desc": "Download speed in (kilobits)",
"default": "",
"parentGroup": "Download speed result"
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.download.kilobytes",
"type": "text",
"desc": "Download speed in (kilobytes)",
"default": "",
"parentGroup": "Download speed result"
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.download.megabits",
"type": "text",
"desc": "Download speed in (megabits)",
"default": "",
"parentGroup": "Download speed result"
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.download.megabytes",
"type": "text",
"desc": "Download speed in (megabytes)",
"default": "",
"parentGroup": "Download speed result"
},
"default": ""
}
],
"events": [],
"connectors": []
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.upload",
"name": "Upload Speed Results",
"actions": [],
"states": [
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.upload.bits",
"type": "text",
"desc": "Upload speed in (bits)",
"default": "",
"parentGroup": "Upload speed result"
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.upload.bytes",
"type": "text",
"desc": "Upload speed in (bytes)",
"default": "",
"parentGroup": "Upload speed result"
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.upload.kilobits",
"type": "text",
"desc": "Upload speed in (kilobits)",
"default": "",
"parentGroup": "Upload speed result"
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.upload.kilobytes",
"type": "text",
"desc": "Upload speed in (kilobytes)",
"default": "",
"parentGroup": "Upload speed result"
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.upload.megabits",
"type": "text",
"desc": "Upload speed in (megabits)",
"default": "",
"parentGroup": "Upload speed result"
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.upload.megabytes",
"type": "text",
"desc": "Upload speed in (megabytes)",
"default": "",
"parentGroup": "Upload speed result"
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.ping",
"type": "text",
"desc": "Ping",
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.isp",
"type": "text",
"desc": "ISP",
"default": ""
},
{
"id": "com.KillerBOSS.TPPlugins.TPSpeedTest.st.result.image",
"type": "text",
"desc": "Image",
"default": ""
}
],
Expand Down
Loading

0 comments on commit 0e95841

Please sign in to comment.