Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lghorizon/lghorizon_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ class LGHorizonApi:
_customer: LGHorizonCustomer
_channels: Dict[str, LGHorizonChannel]
_entitlements: LGHorizonEntitlements
_profile_id: str
_profile_id: Optional[str]
_initialized: bool = False
_devices: Dict[str, LGHorizonDevice] = {}
_message_factory: LGHorizonMessageFactory = LGHorizonMessageFactory()
_device_state_processor: LGHorizonDeviceStateProcessor | None
_recording_factory: LGHorizonRecordingFactory = LGHorizonRecordingFactory()

def __init__(self, auth: LGHorizonAuth, profile_id: str = "") -> None:
"""Initialize LG Horizon API client."""
def __init__(self, auth: LGHorizonAuth, profile_id: Optional[str]) -> None:
"""Initialize LG Horizon API client.

Args:
Expand All @@ -62,7 +61,7 @@ async def initialize(self) -> None:
"""Initialize the API client."""
self._service_config = await self.auth.get_service_config()
self._customer = await self._get_customer_info()
if self._profile_id == "":
if not self._profile_id:
self._profile_id = list(self._customer.profiles.keys())[0]
await self._refresh_entitlements()
await self._refresh_channels()
Expand Down