From 5a1b65bcc200e5b97285574f7310f0034efd849e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20P=C3=B6schl?= Date: Wed, 22 Jan 2020 20:48:41 +0100 Subject: [PATCH 1/4] Add oauth token doc --- source/_integrations/twitch.markdown | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/source/_integrations/twitch.markdown b/source/_integrations/twitch.markdown index 4ba79e52fd78..252e2c5e7c8b 100644 --- a/source/_integrations/twitch.markdown +++ b/source/_integrations/twitch.markdown @@ -10,9 +10,19 @@ ha_iot_class: Cloud Polling 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. -## Setup +## Setup client id -Create a new app at "Register Your Application" in the [Twitch developer portal](https://glass.twitch.tv/console/apps). Then get the **Client ID** for the new app. +Create a new app at "Register Your Application" in the [Twitch developer portal](https://glass.twitch.tv/console/apps). Then get the __Client ID__ for the new app. + +## 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, just ignore the config setting `oauth_token`. + +To get the oauth token visit the [OAuth Token Generator](https://twitchapps.com/tokengen/#), insert your __Client ID__ and `user_read user_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 __Summit__ button, accept the consent screen screen and get your __OAuth Token__. ## Configuration @@ -23,6 +33,7 @@ To use Twitch with your installation, add the following to your `configuration.y sensor: platform: twitch client_id: YOUR_TWITCH_CLIENT_ID + oauth_token: YOUR_TWITCH_OAUTH_TOKEN channels: - channel1 - channel2 @@ -33,6 +44,10 @@ client_id: description: Your Twitch client ID. required: true type: string +oauth_token: + description: Your Twitch OAuth Token. + required: false + type: string channels: description: List of channels names required: true From cce3fec791906a69d96e28d0d00bdc9d2e0a03a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20P=C3=B6schl?= Date: Mon, 17 Feb 2020 13:32:02 +0100 Subject: [PATCH 2/4] Adjust to latest config changes --- source/_integrations/twitch.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/_integrations/twitch.markdown b/source/_integrations/twitch.markdown index 252e2c5e7c8b..55e07026621a 100644 --- a/source/_integrations/twitch.markdown +++ b/source/_integrations/twitch.markdown @@ -17,7 +17,7 @@ Create a new app at "Register Your Application" in the [Twitch developer portal] ## 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, just ignore the config setting `oauth_token`. +If you don't need those, just 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 user_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. @@ -33,7 +33,7 @@ To use Twitch with your installation, add the following to your `configuration.y sensor: platform: twitch client_id: YOUR_TWITCH_CLIENT_ID - oauth_token: YOUR_TWITCH_OAUTH_TOKEN + token: YOUR_TWITCH_OAUTH_TOKEN channels: - channel1 - channel2 @@ -44,7 +44,7 @@ client_id: description: Your Twitch client ID. required: true type: string -oauth_token: +token: description: Your Twitch OAuth Token. required: false type: string From 86170a15005dba4bcaf0dd551f7dc729ee5c2ba3 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 18 Feb 2020 21:50:05 +0100 Subject: [PATCH 3/4] :pencil2: Tweaks --- source/_integrations/twitch.markdown | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/_integrations/twitch.markdown b/source/_integrations/twitch.markdown index 55e07026621a..74adf7d854f5 100644 --- a/source/_integrations/twitch.markdown +++ b/source/_integrations/twitch.markdown @@ -10,19 +10,22 @@ ha_iot_class: Cloud Polling 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. -## Setup client id +## Setup Client ID -Create a new app at "Register Your Application" in the [Twitch developer portal](https://glass.twitch.tv/console/apps). Then get the __Client ID__ for the new app. +Create a new app at "Register Your Application" in the [Twitch developer portal](https://glass.twitch.tv/console/apps). Then get the __Client ID__ 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, just ignore the configuration setting `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 user_subscriptions` inside __scopes__. -To get the oauth token visit the [OAuth Token Generator](https://twitchapps.com/tokengen/#), insert your __Client ID__ and `user_read user_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 __Summit__ button, accept the consent screen screen and get your __OAuth Token__. + +As __OAuth Redirect URLs__ add `https://twitchapps.com/tokengen/` and click __Create__ +. +Back at the Token Generator, click the __Summit__ button, accept the consent screen and get your __OAuth Token__. ## Configuration From fe0a1746c1866648efec7ffb7efa0476479d35df Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 18 Feb 2020 21:50:35 +0100 Subject: [PATCH 4/4] Remove optional config from example --- source/_integrations/twitch.markdown | 1 - 1 file changed, 1 deletion(-) diff --git a/source/_integrations/twitch.markdown b/source/_integrations/twitch.markdown index 74adf7d854f5..38fab3d6634a 100644 --- a/source/_integrations/twitch.markdown +++ b/source/_integrations/twitch.markdown @@ -36,7 +36,6 @@ To use Twitch with your installation, add the following to your `configuration.y sensor: platform: twitch client_id: YOUR_TWITCH_CLIENT_ID - token: YOUR_TWITCH_OAUTH_TOKEN channels: - channel1 - channel2