Skip to content

Turn a ~$5 AliExpress clock into a physical AI usage dashboard (Claude, Codex, multi-account). No firmware flashing.

Stop when start --device-url disagrees with the saved clock

click6067-ship-itae7bf4aabb2f
diff --git a/docs/hardware-compatibility.md b/docs/hardware-compatibility.md
index ccc0ea7..05c448e 100644
--- a/docs/hardware-compatibility.md
+++ b/docs/hardware-compatibility.md
@@ -8,7 +8,7 @@ not "probably fine".
| Clock | Firmware web UI | What TokenTV uses | Checked |
| --- | --- | --- | --- |
| The author's 240×240 GeekMagic SmallTV-style Wi-Fi clock (receipt: ₩5,650 on a Korean AliExpress discount; prices vary by region) | Stock firmware with the **SD_PRO** web UI and a photo album | `/theme/list`, `/photo/list`, `/photo/upload`, photo theme id `2` | One unit, Linux host |
-| GeekMagic **SmallTV-Ultra** | Stock firmware `Ultra-V9.0.54` (`/v.json` reports `SmallTV-Ultra`) | `/app.json`, `/album.json`, `/doUpload?dir=/image/`, `/set?img=`, Photo Album theme `3` | The contributor's unit ([#7](https://github.com/click6067-ship-it/token-tv/pull/7)). The author has no Ultra and has not checked it on a real clock |
+| GeekMagic **SmallTV-Ultra** | Stock firmware `Ultra-V9.0.54` (`/v.json` reports `SmallTV-Ultra`) | `/app.json`, `/album.json`, `/doUpload?dir=/image/`, `/set?img=`, Photo Album theme `3` | The contributor's unit, running this release's code: photos and a display receipt in [#7](https://github.com/click6067-ship-it/token-tv/pull/7). The author has no Ultra |
TokenTV never flashes firmware and never deletes your photos. It uploads one picture, switches the
clock to its photo theme, and `token-tv run --restore-display` puts the original theme back.
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 0cdb084..ec3858e 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -243,6 +243,29 @@ class StartTest(unittest.TestCase):
detect.assert_not_called()
run.assert_called_once()
+ def saved_config(self, device_url):
+ config = {'device_url': device_url, 'accounts': [{'key': 'codex_a', 'alias': 'CODEX A', 'provider': 'codex',
+ 'email': '[email protected]', 'source_home': '~/.codex'}]}
+ self.config.write_text(json.dumps(config))
+ return config
+
+ def test_new_clock_address_with_existing_config_stops_and_says_where(self):
+ # Reported in #7: the clock's IP changed and --device-url was silently ignored.
+ saved = self.saved_config('http://192.168.0.50')
+ code, _, err, _, run = self.start('--device-url', '192.168.0.77')
+ self.assertEqual(code, 1)
+ self.assertIn('http://192.168.0.50', err)
+ self.assertIn('http://192.168.0.77', err)
+ self.assertIn(str(self.config), err)
+ self.assertEqual(json.loads(self.config.read_text()), saved)
+ run.assert_not_called()
+
+ def test_same_clock_address_with_existing_config_runs(self):
+ self.saved_config('http://192.168.0.50')
+ code, _, err, _, run = self.start('--device-url', '192.168.0.50')
+ self.assertEqual((code, err), (0, ''))
+ run.assert_called_once()
+
def test_nothing_signed_in_explains_next_step(self):
from token_tv import live
with mock.patch.object(cli, 'cli_path', return_value=None), mock.patch.object(live, 'main') as run:
diff --git a/token_tv/cli.py b/token_tv/cli.py
index 4cf8659..60848bb 100644
--- a/token_tv/cli.py
+++ b/token_tv/cli.py
@@ -279,8 +279,22 @@ def start(args):
json.dump(config, handle, indent=2)
handle.write('\n')
print(f'Saved {path} (emails and paths only, no secrets).')
- if read_config(path) is None:
+ config = read_config(path)
+ if config is None:
return 1
+ if args.device_url and path.exists():
+ # --device-url only fills a new config; say so rather than quietly using the saved clock.
+ wanted = args.device_url if args.device_url.startswith(('http://', 'https://')) else 'http://' + args.device_url
+ try:
+ wanted = device_address(wanted)
+ except ValueError as error:
+ print(error, file=sys.stderr)
+ return 1
+ if wanted != config.get('device_url'):
+ print(f'{path} already sets the clock to {config.get("device_url") or "none (dashboard only)"}, '
+ f'and --device-url is only used when that file is created.\n'
+ f'To use {wanted}, change device_url in that file, then run token-tv start again.', file=sys.stderr)
+ return 1
if not args.no_browser:
import threading
import webbrowser