How aakashdeeeep/wallops works
Purpose and entry points
Quickplay SOC Automation is a local Flask control system for a 56-device TV wall used in OTT live/VOD testing. The server starts at app.py; database initialization is performed by db.py. Operators use rendered dashboard/admin pages, while automation clients can call JSON endpoints such as network scanning.
Flask application boundary
app.py assembles the web application and registers page/API route modules. routes/views.py owns operator-facing navigation and dashboard pages; routes/api.py exposes action-oriented endpoints for device management, scans, status, and launches. UI behavior is implemented by page-specific scripts such as static/js/tv_dashboard.js and static/js/admin_devices.js.
Persistent device registry and domain model
SQLite is the source of truth for known wall devices, created at runtime under data/wall.db. models.py defines registry-oriented data access/model structures, while db.py initializes storage. Device MAC addresses are treated as permanent identities; IP addresses and network assignments are mutable discovery results. Bulk bootstrap/import paths include seed_devices.py and import_device_registry.py.
Slot and content assignment layer
A device slot represents a wall position/channel, with identifiers such as TV1-CH11. slot_naming.py converts those IDs into TV-group and channel semantics used by selection and grouping flows. content_catalog.py maintains content/platform/title/type assignments for slots, with import support in import_content_catalog.py; these assignments feed launch decisions rather than directly controlling devices.
Device-control dispatcher
device_control/launcher.py is the protocol-neutral launch boundary: route-level requests should resolve a registered device and dispatch to the correct platform adapter. device_control/roku.py implements Roku launches through ECP HTTP requests. device_control/adb.py implements Android TV, Fire TV, and Google TV operations through wireless ADB subprocess calls. device_control/appletv.py exists as an extension point for planned Apple TV support.
Discovery, identity refresh, and connectivity
Network discovery is separated from registry persistence and control. device_control/scanner.py finds reachable devices, device_control/mac_lookup.py resolves MAC identity through ARP-based lookup, and device_control/background_scanner.py supports ongoing refresh work. device_control/status.py performs online/offline probing. Discovery results update transient IP/network data for registered MAC identities; scripts such as scan_subnet.py, discover_roku.py, and discover_adb_port.py support operational discovery workflows.
Infrastructure and external protocols
The runtime is Python 3 with Flask and SQLite. Roku devices are controlled over Roku ECP via HTTP (requests); Android-family devices are controlled via wireless ADB using OS subprocess execution. Network scanning, ARP/MAC resolution, and ADB pairing/reconnection are operational dependencies, with support scripts in pair_wireless_adb.py and reconnect_wireless_adb.py. Network definitions, protocol ports, platform app identifiers, presets, and OPS access restrictions are centralized in config.py.
Main entry points: launcher.py Launch dispatcher · scanner.py Network discovery · models.py Registry model access · api.py Automation API
Components 19
Flask UI & API
- Flask application · Assembles the server and registers route modules.
app.py - Operator pages
routes/views.py - Automation API · Action endpoints for devices, scans, status, and launches.
routes/api.py - TV dashboard UI
static/js/tv_dashboard.js - Device admin UI
static/js/admin_devices.js
Registry & Assignments
- Database initialization
db.py - Wall device registry · MAC identity is permanent; IP and network fields are refreshed.
- Registry model access
models.py - Slot naming · Maps slot IDs to TV-group and channel meanings.
slot_naming.py - Content catalog · Slot content assignments inform launch decisions.
content_catalog.py
Control & Discovery
- Launch dispatcher · Resolves a registered device and selects its platform adapter.
device_control/launcher.py - Network discovery
device_control/scanner.py - MAC identity lookup
device_control/mac_lookup.py - Background refresh
device_control/background_scanner.py - Connectivity status
device_control/status.py
Platform Protocols
- Roku adapter · Launches through ECP HTTP requests.
device_control/roku.py - Android-family adapter · Controls Android TV, Fire TV, and Google TV via subprocess calls.
device_control/adb.py - Apple TV adapter · Planned Apple TV control adapter.
device_control/appletv.py
Other components
- Runtime configuration · Centralizes network, ports, app IDs, presets, and access restrictions.
config.py
Connections 23
- Flask application → Operator pages: registers
- Flask application → Automation API: registers
- Operator pages → TV dashboard UI: serves UI for
- Operator pages → Device admin UI: serves UI for
- Automation API → Launch dispatcher: launch requests
- Automation API → Network discovery: scan requests
- Automation API → Connectivity status: status requests
- Database initialization → Wall device registry: creates
- Registry model access → Wall device registry: reads and writes
- Launch dispatcher → Registry model access: resolves device
- Launch dispatcher → Content catalog: uses assignment
- Content catalog → Slot naming: assigns by slot
- Launch dispatcher → Roku adapter: dispatches Roku
- Launch dispatcher → Android-family adapter: dispatches Android family
- Launch dispatcher → Apple TV adapter: future dispatch
- Network discovery → MAC identity lookup: resolves identity
- MAC identity lookup → Registry model access: matches MAC registry
- Network discovery → Registry model access: refreshes IP and network
- Background refresh → Network discovery: runs ongoing refresh
- Connectivity status → Registry model access: probes registered devices
- Runtime configuration → Launch dispatcher: platform settings
- Runtime configuration → Network discovery: network definitions
- Runtime configuration → Android-family adapter: ADB settings