<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>lights &#8211; About Things | A Hans Scharler Blog</title>
	<atom:link href="https://nothans.com/tag/lights/feed" rel="self" type="application/rss+xml" />
	<link>https://nothans.com</link>
	<description>Life, Comedy, Games, Tech, Marketing, and Community</description>
	<lastBuildDate>Wed, 16 Nov 2022 23:54:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/nothans.com/wp-content/uploads/2023/02/cropped-settings.png?fit=32%2C32&#038;ssl=1</url>
	<title>lights &#8211; About Things | A Hans Scharler Blog</title>
	<link>https://nothans.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">114568856</site>	<item>
		<title>LIFX Cloud API Authentication</title>
		<link>https://nothans.com/lifx-cloud-api-authentication</link>
					<comments>https://nothans.com/lifx-cloud-api-authentication#respond</comments>
		
		<dc:creator><![CDATA[Hans Scharler]]></dc:creator>
		<pubDate>Wed, 16 Nov 2022 23:53:31 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[internet of things]]></category>
		<category><![CDATA[iot]]></category>
		<category><![CDATA[lifx]]></category>
		<category><![CDATA[lights]]></category>
		<category><![CDATA[projects]]></category>
		<guid isPermaLink="false">https://nothans.com/?p=3446</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<p><a href="https://amzn.to/3EEOIvR" target="_blank" rel="noreferrer noopener">LIFX</a> makes some excellent Wi-Fi light bulbs and LED strips. Right after I got my first light from LIFX, I wanted to control those lights from an API and make a cool light fixture for my house.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><a href="https://www.instagram.com/p/BTISd08ghl7/" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" fetchpriority="high" decoding="async" data-attachment-id="3447" data-permalink="https://nothans.com/lifx-cloud-api-authentication/image-5-2" data-orig-file="https://i0.wp.com/nothans.com/wp-content/uploads/2022/11/image-5.png?fit=778%2C777&amp;ssl=1" data-orig-size="778,777" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image-5" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/nothans.com/wp-content/uploads/2022/11/image-5.png?fit=750%2C749&amp;ssl=1" src="https://i0.wp.com/nothans.com/wp-content/uploads/2022/11/image-5.png?resize=389%2C389&#038;ssl=1" alt="" class="wp-image-3447" width="389" height="389" srcset="https://i0.wp.com/nothans.com/wp-content/uploads/2022/11/image-5.png?w=778&amp;ssl=1 778w, https://i0.wp.com/nothans.com/wp-content/uploads/2022/11/image-5.png?resize=300%2C300&amp;ssl=1 300w, https://i0.wp.com/nothans.com/wp-content/uploads/2022/11/image-5.png?resize=150%2C150&amp;ssl=1 150w, https://i0.wp.com/nothans.com/wp-content/uploads/2022/11/image-5.png?resize=768%2C767&amp;ssl=1 768w, https://i0.wp.com/nothans.com/wp-content/uploads/2022/11/image-5.png?resize=530%2C530&amp;ssl=1 530w, https://i0.wp.com/nothans.com/wp-content/uploads/2022/11/image-5.png?resize=750%2C749&amp;ssl=1 750w, https://i0.wp.com/nothans.com/wp-content/uploads/2022/11/image-5.png?resize=500%2C500&amp;ssl=1 500w" sizes="(max-width: 389px) 100vw, 389px" /></a><figcaption class="wp-element-caption">Outside Light with a LIFX Light Bulb</figcaption></figure>
</div>


<p>LIFX lets you control the lights with the LIFX Cloud API. The only thing stopping you is the authentication token. The token will be needed to send API requests to the LIFX Cloud API to leverage all of the commands in the <a rel="noreferrer noopener" href="https://api.developer.lifx.com/reference/introduction" target="_blank">HTTP REMOTE CONTROL API</a>. All requests require an OAuth 2 access token. </p>


<h2 class="wp-block-heading" id="how-to-get-your-lifx-bearer-token">How to get your LIFX Bearer Token</h2>


<p>To get your access token for LIFX, go to: <a rel="noreferrer noopener" href="https://cloud.lifx.com/" target="_blank">https://cloud.lifx.com/</a>, sign in with the same account that you registered your lights, and click <a rel="noreferrer noopener" href="https://cloud.lifx.com/settings" target="_blank">Settings</a>. Under <em>Personal access tokens</em>, click <em>GENERATE NEW TOKEN</em>, enter a label, and click <em>Generate</em>. This will generate a new token that you can use for the LIFX Cloud API. Caution thought. This will be the last time that you see this token. If you lose it, you will have to generate a new API key.</p>


<h2 class="wp-block-heading" id="how-to-use-the-lifx-access-token">How to use the LIFX Access Token</h2>


<p>I recommend using the LIFX token in the HTTP authorization header. It is pretty easy to do. Here&#8217;s an example in Python.</p>



<pre class="wp-block-code"><code>import requests

token = "&#91;&#91;app:Token]]"

headers = {
    "Authorization": "Bearer %s" % token,
}

response = requests.get('https://api.lifx.com/v1/lights/all', headers=headers)</code></pre>



<p>Have fun and build some cool integrations with the LIFX Cloud API!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nothans.com/lifx-cloud-api-authentication/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3446</post-id>	</item>
	</channel>
</rss>
