Tags: Sholofly/lghorizon-python
Tags
Feature/entitlement features (#100) * feat: add entitlement features, recording type detection, and recording capacity support - Add features, has_pvr, has_local_dvr, has_recording properties to entitlements and API - Add recording_type, cpe_id, is_local_recording to recording base class - Route MQTT CPE.capacity messages to devices for local recording capacity - Rename recording_capacity to local_recording_capacity on device - Update recording guards to use entitlements.has_recording - Export LGHorizonEntitlements in __init__.py - Add /api/recording-capacity endpoint to web.py - Add recording capacity UI strip to web dashboard with cloud quota and local device info * chore: add debug/test files to .gitignore * chore: add ssdp_scan.py to .gitignore
Feature/media keys tabbed UI (#98) * feat: add all media keys, per-box tabbed UI with remote control layout - Add 40+ media key constants to const.py grouped by category (Power, Playback, Navigation, D-Pad, Colour, Digits) - Add /api/keys endpoint to web.py - Redesign web_ui.html: per-box tabs instead of grid, full-page remote control layout with D-pad cross, numpad, colour buttons, and all keys * feat: export all media key constants from package __init__ * feat: add set_channel_by_number and deduplicate channels by number - Add set_channel_by_number() to LGHorizonDevice for tuning by channel number instead of name - Refactor set_channel to share _tune_to_channel helper - Deduplicate channels in _refresh_channels: keep last entry per logicalChannelNumber (HD over SD) - Add set_channel_by_number command to web.py * fix: deduplicate channels at output layer instead of storage Move channel deduplication from _refresh_channels to get_profile_channels so all channel IDs remain in _channels for state processor lookups. Prevents KeyError when the box reports a channel variant (e.g. SD) that was previously removed by dedup. * fix: switch channels by number instead of name to avoid duplicates Web UI and CLI now use set_channel_by_number to prevent ambiguity when multiple channels share the same name but have different numbers. * feat: add /api/explore and /api/services endpoints for API discovery
Feature/media keys tabbed UI (#97) * feat: add all media keys, per-box tabbed UI with remote control layout - Add 40+ media key constants to const.py grouped by category (Power, Playback, Navigation, D-Pad, Colour, Digits) - Add /api/keys endpoint to web.py - Redesign web_ui.html: per-box tabs instead of grid, full-page remote control layout with D-pad cross, numpad, colour buttons, and all keys * feat: export all media key constants from package __init__ * feat: add set_channel_by_number and deduplicate channels by number - Add set_channel_by_number() to LGHorizonDevice for tuning by channel number instead of name - Refactor set_channel to share _tune_to_channel helper - Deduplicate channels in _refresh_channels: keep last entry per logicalChannelNumber (HD over SD) - Add set_channel_by_number command to web.py * fix: deduplicate channels at output layer instead of storage Move channel deduplication from _refresh_channels to get_profile_channels so all channel IDs remain in _channels for state processor lookups. Prevents KeyError when the box reports a channel variant (e.g. SD) that was previously removed by dedup. * fix: switch channels by number instead of name to avoid duplicates Web UI and CLI now use set_channel_by_number to prevent ambiguity when multiple channels share the same name but have different numbers.
Fix BBC Launcher metadata flapping on UK channels (#85) When BBC channels display their launcher overlay, the set-top box briefly reports app state with generic "BBC Launcher" metadata, overwriting valid program information. This causes artwork and channel info to flicker. This fix: - Caches valid linear metadata after successful linear/replay processing - Detects launcher app overlays (name contains "launcher" or appstore logo) - Restores cached metadata instead of showing generic launcher info - Clears cache on standby/offline to prevent stale data Fixes issue where BBC channels show correct info for 2-3 seconds then revert to "BBC Launcher" with no artwork. Co-authored-by: Rudolf Offereins <r.offereins@gmail.com>
Feature/interactive cli (#96) * feat: add interactive CLI for live monitoring with box commands Replace passive Enter-to-quit with interactive command loop that allows sending messages, switching channels, controlling playback, and sending key presses to set-top boxes during live monitoring. * feat: add web-based test UI for interactive library testing Adds web.py (aiohttp server) and web_ui.html (SPA frontend) providing a browser-based interface to login, monitor devices live via WebSocket, and control set-top boxes. Includes session resume on page reload, credential persistence (username/country only), and README documentation.
feat: add ad break detection and skip functionality for nDVR recordin… …gs (#95) * feat: add ad break detection and skip functionality for nDVR recordings Parse adManifest from MQTT nDVR source to expose ad break boundaries. Add LGHorizonAdBreak model, is_in_ad_break/current_ad_break_end properties on device state, and skip_ad_break() method on device for seeking past ads. * feat: show ad break info in main.py device state callback
Use profile language instead of hardcoded defaults for EPG, event det… …ail and replay channels (#94) get_epg, get_event_detail and get_replay_channels had hardcoded language defaults ('en'/'nl'). Now default to the user's profile language via get_profile_lang(), consistent with other API methods. Callers can still override explicitly.
Fix NDVR recording timestamp parsing crashing on numeric epoch values (… …#93) The recording detail API returns startTime/endTime as epoch seconds (numbers), but _process_ndvr_state assumed ISO-8601 strings and called .replace() on them, causing an AttributeError. This left duration, show_title, media_type and image unset for recordings. Add _parse_timestamp helper that handles both numeric epochs and ISO-8601 strings with safe fallback.
Fix: Use refresh token auth when refresh_token is explicitly provided (… …#83) When a refresh_token is passed to LGHorizonAuth(), use refresh token authentication regardless of the country's use_refreshtoken setting. The country setting should only determine the initial auth method. If a refresh token exists from a previous auth, it should be used.
PreviousNext