Skip to content

Commit

Permalink
Ch refresh (#143)
Browse files Browse the repository at this point in the history
* Fix CH login using refresh

* ⬆️ bump versions
  • Loading branch information
Sholofly authored Oct 26, 2024
1 parent 0b0a904 commit 2059ad5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions custom_components/lghorizon/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
4 changes: 2 additions & 2 deletions custom_components/lghorizon/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion custom_components/lghorizon/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"password": "Password",
"country_code": "Provider",
"identifier": "DTV identifier",
"refresh_token": "Refresh Token (GB)"
"refresh_token": "Refresh Token (GB & CH)"
}
},
"profile": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/lghorizon/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"password": "Wachtwoord",
"country_code": "Provider",
"identifier": "DTV identifier",
"refresh_token": "Refresh Token (GB)"
"refresh_token": "Refresh Token (GB & CH)"
}
},
"profile": {
Expand Down

0 comments on commit 2059ad5

Please sign in to comment.