2 Commits

Author SHA1 Message Date
Mortdecai 8f2bd2b015 fix: power_off works under systemd — absolute key path + freshly-woken retry
Two OFF-path bugs found during live testing:
- bscpylgtv's key store defaulted to a CWD-relative ./.aiopylgtv.sqlite;
  under systemd (cwd=/) it couldn't open the pairing key db. Pass an
  absolute key_file_path (LGTV_KEY_FILE override, else ~/.aiopylgtv.sqlite).
- A TV woken seconds earlier answers TCP :3000 but rejects WebSocket control
  for ~20-30s. Retry power_off (2 attempts, 10s apart); common case still
  succeeds first try in ~3s. Kept under the bridge's 60s subprocess timeout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 20:16:20 -04:00
Mortdecai 1699276e8e feat: consolidate LG TV bridge — cached IP discovery, robust WoL, systemd deploy
Rework the MQTT bridge into a single deployable unit:
- Drop the self-SSH hop; run locally on steel141 (on the TV's LAN, has
  bscpylgtv, effectively always-on).
- Cache last-known TV IP and probe it directly; /24 ping-sweep only on a
  cache miss. Stops the 30s HA state poll from flapping/spamming the net.
- WoL now unicast (last-known IP) + broadcast, ports 9/7, 3 bursts.
- systemd unit (User=seth, EnvironmentFile for MQTT_PASSWORD), install.sh,
  env template, .gitignore. Removes the half-finished lgtv.sh.new.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 19:29:01 -04:00