From 4b20078f9df9d64fac3e40e91094b5e139f7f715 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Wed, 27 Sep 2023 15:44:42 +0200 Subject: [PATCH] Add config flow to Twitch (#29049) --- source/_integrations/twitch.markdown | 52 ++-------------------------- 1 file changed, 3 insertions(+), 49 deletions(-) diff --git a/source/_integrations/twitch.markdown b/source/_integrations/twitch.markdown index 3ad57ca98c7..5c810b4631b 100644 --- a/source/_integrations/twitch.markdown +++ b/source/_integrations/twitch.markdown @@ -13,56 +13,10 @@ ha_codeowners: - '@joostlek' --- -The `twitch` platform will allow you to monitor [Twitch](https://www.twitch.tv/) channel status from within Home Assistant and setup automation based on the information. +The Twitch integration will allow you to monitor [Twitch](https://www.twitch.tv/) channel status from within Home Assistant and setup automation based on the information. -## Setup Client ID and Client secret +## Get Twitch application credentials Create a new app at "Register Your Application" in the [Twitch developer portal](https://dev.twitch.tv/console/apps). Then get the __Client ID__ and __Client secret__ for the new application. -## Setup OAuth Token - -To enable the follow and subscription attributes, the OAuth token is needed to get the right permissions on the Twitch API. -If you don't need those, ignore the configuration setting: `token`. - -To get the OAuth token, visit the [OAuth Token Generator](https://twitchapps.com/tokengen/#), insert your __Client ID__ and `user:read:subscriptions` inside __scopes__. - -Before clicking Summit (the broken image below the form), visit the [Twitch dev console](https://dev.twitch.tv/console) and add a new application. - -As __OAuth Redirect URLs__ add `https://twitchapps.com/tokengen/` and click __Create__ -. -Back at the Token Generator, click the __Connect__ button, accept the consent screen and get your __OAuth Token__. - -## Configuration - -To use Twitch with your installation, add the following to your `configuration.yaml` file: - -```yaml -# Example configuration.yaml entry -sensor: - platform: twitch - client_id: YOUR_TWITCH_CLIENT_ID - client_secret: YOUR_TWITCH_CLIENT_SECRET - token: YOUR_TWITCH_OAUTH_TOKEN - channels: - - channel1 - - channel2 -``` - -{% configuration %} -client_id: - description: Your Twitch client ID. - required: true - type: string -client_secret: - description: Your Twitch client secret. - required: true - type: string -token: - description: Your Twitch OAuth Token. - required: false - type: string -channels: - description: List of channels names - required: true - type: list -{% endconfiguration %} +{% include integrations/config_flow.md %}