aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-16 17:51:52 +0100
committerDanilo M. <danix@danix.xyz>2026-11-16 17:51:52 +0100
commit903a4527a9ed8802800c0fd0c09123ef3cde4c55 (patch)
tree4825dd778c61dfd29ae98b532cda2582ae570801
parenta81ad9738e9013557b2bd3cbdd7014d981f032fe (diff)
downloaddeck-it-903a4527a9ed8802800c0fd0c09123ef3cde4c55.tar.gz
deck-it-903a4527a9ed8802800c0fd0c09123ef3cde4c55.zip
fix(xbox): say what to do when the console is unreachable
-rw-r--r--deckit/modules/xbox.py4
-rw-r--r--tests/test_xbox.py7
2 files changed, 11 insertions, 0 deletions
diff --git a/deckit/modules/xbox.py b/deckit/modules/xbox.py
index 9254f99..bd2fd6e 100644
--- a/deckit/modules/xbox.py
+++ b/deckit/modules/xbox.py
@@ -506,6 +506,10 @@ class Xbox:
msg = isinstance(e, HttpError) and (e.body.get("status") or {}).get("errorMessage")
raise ModuleError(msg or f"{name} failed: {e}") from e
status = r.get("status") or {}
+ if status.get("errorCode") == "ErrorCallingWNS":
+ # Xbox Live could not push to the console: it lost its registration
+ # (after an update, or a night signed out); the Xbox app fails too.
+ raise ModuleError("The console is not reachable from Xbox Live: turn it on by hand once, then retry.")
if status.get("errorCode", "OK") != "OK":
raise ModuleError(status.get("errorMessage") or status["errorCode"])
self.wake.set()
diff --git a/tests/test_xbox.py b/tests/test_xbox.py
index 8844e3b..d37423e 100644
--- a/tests/test_xbox.py
+++ b/tests/test_xbox.py
@@ -410,6 +410,13 @@ class Commands(Base):
with self.assertRaises(xb.ModuleError):
x.command("wake", {"console": "OTHER"})
+ def test_an_unreachable_console_says_what_to_do(self):
+ self.fake.answers["/commands"] = {"status": {"errorCode": "ErrorCallingWNS", "errorMessage": "Send command failed"}}
+ x = self.xbox()
+ x.tick()
+ with self.assertRaisesRegex(xb.ModuleError, "turn it on by hand"):
+ x.command("wake", {"console": "CON1"})
+
def test_an_xccs_error_becomes_the_message(self):
self.fake.answers["/commands"] = {"status": {"errorCode": "DeviceUnavailable", "errorMessage": "Console is off"}}
x = self.xbox()