From e6dd15c011c6178288c8f68aebb23019cf3cdab0 Mon Sep 17 00:00:00 2001 From: Rudolf Offereins Date: Thu, 5 Feb 2026 20:11:00 +0000 Subject: [PATCH 1/3] Fix callback error --- lghorizon/lghorizon_device.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lghorizon/lghorizon_device.py b/lghorizon/lghorizon_device.py index 2c20d7f..f25c902 100644 --- a/lghorizon/lghorizon_device.py +++ b/lghorizon/lghorizon_device.py @@ -74,6 +74,7 @@ def __init__( self._model = None self._recording_capacity = None self._device_state_processor = device_state_processor + self._change_callback = None @property def device_id(self) -> str: From e33c3b0d97c3269647d20c2b9af98fbf12cb1a82 Mon Sep 17 00:00:00 2001 From: Rudolf Offereins Date: Thu, 5 Feb 2026 20:16:37 +0000 Subject: [PATCH 2/3] Fix main error --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index e5eb563..59c6385 100644 --- a/main.py +++ b/main.py @@ -80,7 +80,7 @@ async def main(): async with aiohttp.ClientSession() as session: auth = LGHorizonAuth(session, country, username=username, password=password) - api = LGHorizonApi(auth) + api = LGHorizonApi(auth, profile_id=None) # Start the input reader task input_task = asyncio.create_task(read_input_and_signal_shutdown()) From ff69ca4adcfe9775b5e13e0cf12b3ed67a2a6330 Mon Sep 17 00:00:00 2001 From: Rudolf Offereins Date: Thu, 5 Feb 2026 20:36:04 +0000 Subject: [PATCH 3/3] Fix cloud recording --- lghorizon/lghorizon_api.py | 7 +++++++ lghorizon/lghorizon_models.py | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lghorizon/lghorizon_api.py b/lghorizon/lghorizon_api.py index 7c488b0..db75036 100644 --- a/lghorizon/lghorizon_api.py +++ b/lghorizon/lghorizon_api.py @@ -1,6 +1,7 @@ """LG Horizon API client.""" import logging +import json from typing import Any, Dict, cast, Callable, Optional from .lghorizon_device import LGHorizonDevice @@ -261,6 +262,8 @@ async def _refresh_channels(self): async def get_all_recordings(self) -> LGHorizonRecordingList: """Retrieve all recordings.""" + if not self._customer.has_cloud_recording: + return LGHorizonRecordingList([]) _LOGGER.debug("Retrieving recordings...") service_url = await self._service_config.get_service_url("recordingService") lang = await self._customer.get_profile_lang(self._profile_id) @@ -275,6 +278,8 @@ async def get_show_recordings( self, show_id: str, channel_id: str ) -> LGHorizonShowRecordingList: # type: ignore[valid-type] """Retrieve all recordings.""" + if not self._customer.has_cloud_recording: + return LGHorizonShowRecordingList(None, None, []) _LOGGER.debug("Retrieving recordings fro show...") service_url = await self._service_config.get_service_url("recordingService") lang = await self._customer.get_profile_lang(self._profile_id) @@ -288,6 +293,8 @@ async def get_show_recordings( async def get_recording_quota(self) -> LGHorizonRecordingQuota: """Refresh recording quota.""" _LOGGER.debug("Refreshing recording quota...") + if not self._customer.has_cloud_recording: + return LGHorizonRecordingQuota({}) service_url = await self._service_config.get_service_url("recordingService") quota_json = await self.auth.request( service_url, diff --git a/lghorizon/lghorizon_models.py b/lghorizon/lghorizon_models.py index 4f4c2b2..2575047 100644 --- a/lghorizon/lghorizon_models.py +++ b/lghorizon/lghorizon_models.py @@ -838,6 +838,18 @@ def city_id(self) -> int: """Return the city id.""" return self._json_payload["cityId"] + @property + def recording_retention_period(self) -> Optional[int]: + """Return the city id.""" + return self._json_payload.get("recordingRetentionPeriod", None) + + @property + def has_cloud_recording(self) -> bool: + """Return the city id.""" + return ( + not self.recording_retention_period or self.recording_retention_period <= 0 + ) + @property def assigned_devices(self) -> list[str]: """Return the assigned set-top boxes."""