|
@@ -316,7 +316,7 @@ class OctoTray():
|
316
|
316
|
if method == "unknown":
|
317
|
317
|
unknownCount += 1
|
318
|
318
|
|
319
|
|
- action = QAction(self.getName(p[0], p[1]))
|
|
319
|
+ action = QAction(p[0])
|
320
|
320
|
action.setEnabled(False)
|
321
|
321
|
p.append(action)
|
322
|
322
|
self.menu.addAction(action)
|
|
@@ -469,7 +469,7 @@ class OctoTray():
|
469
|
469
|
pass
|
470
|
470
|
except urllib.error.HTTPError:
|
471
|
471
|
pass
|
472
|
|
- return ""
|
|
472
|
+ return "error"
|
473
|
473
|
|
474
|
474
|
def sendPostRequest(self, host, key, path, content):
|
475
|
475
|
headers = {
|
|
@@ -560,6 +560,9 @@ class OctoTray():
|
560
|
560
|
|
561
|
561
|
def getMethod(self, host, key):
|
562
|
562
|
r = self.sendGetRequest(host, key, "plugin/psucontrol")
|
|
563
|
+ if r == "error":
|
|
564
|
+ return "unknown"
|
|
565
|
+
|
563
|
566
|
try:
|
564
|
567
|
rd = json.loads(r)
|
565
|
568
|
if "isPSUOn" in rd:
|
|
@@ -568,6 +571,9 @@ class OctoTray():
|
568
|
571
|
pass
|
569
|
572
|
|
570
|
573
|
r = self.sendGetRequest(host, key, "system/commands/custom")
|
|
574
|
+ if r == "error":
|
|
575
|
+ return "unknown"
|
|
576
|
+
|
571
|
577
|
try:
|
572
|
578
|
rd = json.loads(r)
|
573
|
579
|
for c in rd:
|