From 2059ad586d35bd561df461bc39bc0db4e59a38e4 Mon Sep 17 00:00:00 2001 From: Rudolf Offereins Date: Sat, 26 Oct 2024 20:12:32 +0200 Subject: [PATCH] Ch refresh (#143) * Fix CH login using refresh * :arrow_up: bump versions --- README.md | 22 ++++++++++--------- custom_components/lghorizon/config_flow.py | 4 ++-- custom_components/lghorizon/manifest.json | 4 ++-- .../lghorizon/translations/en.json | 2 +- .../lghorizon/translations/nl.json | 2 +- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 038b9df..ae48fff 100644 --- a/README.md +++ b/README.md @@ -59,12 +59,12 @@ A media player component for Home Assistant that controls each LG Horizon Settop ### Parameters | Parameter | Required | Description | -| ------------ | --------------------- | ----------------------------------- | +| ------------- | --------------------- | ----------------------------------- | | Username | yes | Your provider username | | Password | yes | Your provider password | | Provider | yes (default 'Ziggo') | Your Provider | | Identifier | no (only for Telenet) | Your account identifier (see below) | -| Refresh Token | no (only for GB) | A JWT Token (see below) | +| Refresh Token | no (only for GB & CH) | A JWT Token (see below) | ## Configuration Telenet multiple accounts @@ -79,8 +79,9 @@ After entering your credentials an account selection screen will popup: ![Identifier code](/images/Telenet%20code.png) - Use that code in the config of your telenet account in HA -## Configuration for Virgin GB -For the Virgin GB integration the Password is not used, instead, you need JWT token. +## Configuration for Virgin GB and Sunrise (CH) + +For the Virgin GB and the Sunrise CH integration the Password is not used, instead, you need JWT token. To get the JWT token you need to download a plugin and then login to your Virgin Box from a web browser as follows. 1. Download a Plug to get access to the tokens: @@ -90,15 +91,16 @@ To get the JWT token you need to download a plugin and then login to your Virgin - For Edge use [JwtToken](https://microsoftedge.microsoft.com/addons/detail/jwttoken/hbppejkakghldbgjeblinppeindhpeoh?hl=en-us) 2. Login to your Virgin box using the web browser -[https://virgintvgo.virginmedia.com/](https://virgintvgo.virginmedia.com/) + GB: [https://virgintvgo.virginmedia.com/](https://virgintvgo.virginmedia.com/) + CH: [https://www.sunrisetv.ch/](https://www.sunrisetv.ch/) 3. Open the JWT extension and copy the JWT token. -Firefox example: -![account selection](/images/GB%20Firefox%20JWT.png) -(you need the bit starting `eyJ0...` - make sure you get all of it - its quite long. -_NOTE: Keep this token secure/treat as a password - it gives full access to your virgin box._ + Firefox example: + ![account selection](/images/GB%20Firefox%20JWT.png) + (you need the bit starting `eyJ0...` - make sure you get all of it - its quite long. + _NOTE: Keep this token secure/treat as a password - it gives full access to your virgin / sunrise box._ -4. Paste the JWT token into the Refresh Token parameter +4. Paste the JWT token into the Refresh Token parameter ## Service to change channel diff --git a/custom_components/lghorizon/config_flow.py b/custom_components/lghorizon/config_flow.py index 7d3633a..904f06c 100644 --- a/custom_components/lghorizon/config_flow.py +++ b/custom_components/lghorizon/config_flow.py @@ -99,10 +99,10 @@ async def async_step_user( self.CONFIG_DATA.update(user_input) profile_step = await self.async_step_profile(user_input=user_input) return profile_step - - return await self.async_show_form( + user_form = await self.async_show_form( step_id="user", data_schema=user_schema, errors=errors ) + return user_form async def validate_input(self, hass: HomeAssistant, data: dict[str, Any]): """Validate the user input allows us to connect.""" diff --git a/custom_components/lghorizon/manifest.json b/custom_components/lghorizon/manifest.json index ffd30c3..65e49b8 100644 --- a/custom_components/lghorizon/manifest.json +++ b/custom_components/lghorizon/manifest.json @@ -9,7 +9,7 @@ "iot_class": "cloud_push", "issue_tracker": "https://github.com/Sholofly/lghorizon/issues", "requirements": [ - "lghorizon>=0.7.4" + "lghorizon>=0.7.5" ], - "version": "0.6.5" + "version": "0.6.6" } diff --git a/custom_components/lghorizon/translations/en.json b/custom_components/lghorizon/translations/en.json index 236b8a7..55e0017 100644 --- a/custom_components/lghorizon/translations/en.json +++ b/custom_components/lghorizon/translations/en.json @@ -10,7 +10,7 @@ "password": "Password", "country_code": "Provider", "identifier": "DTV identifier", - "refresh_token": "Refresh Token (GB)" + "refresh_token": "Refresh Token (GB & CH)" } }, "profile": { diff --git a/custom_components/lghorizon/translations/nl.json b/custom_components/lghorizon/translations/nl.json index db33ac9..916405b 100644 --- a/custom_components/lghorizon/translations/nl.json +++ b/custom_components/lghorizon/translations/nl.json @@ -10,7 +10,7 @@ "password": "Wachtwoord", "country_code": "Provider", "identifier": "DTV identifier", - "refresh_token": "Refresh Token (GB)" + "refresh_token": "Refresh Token (GB & CH)" } }, "profile": {