home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
HTPC Projects
Hardware
Ambient Lighting System
Support for Philips Hue System
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Rick164" data-source="post: 1103923" data-attributes="member: 17766"><p>if the client is already intialized it skips that at the moment:</p><p></p><p>[code]</p><p> if (client.IsInitialized == false)</p><p> {</p><p> client.Initialize(tbHueAppKey.Text);</p><p> outputtoLog("HUE has been initialized on COLOR CHANGE");</p><p> }</p><p>[/code]</p><p></p><p>And on startup it sets up the connection if an bridge was found:</p><p></p><p>[code]</p><p> if (string.IsNullOrEmpty(tbHueBridgeIP.Text) == false)</p><p> {</p><p> client = new HueClient(hueBridgeIP);</p><p> client.RegisterAsync(hueAppName, hueAppKey);</p><p> try</p><p> {</p><p> client.Initialize(tbHueAppKey.Text);</p><p> outputtoLog("HUE has been intialized on STARTUP");</p><p> }</p><p> catch (Exception et)</p><p> {</p><p> MessageBox.Show(et.ToString());</p><p> }</p><p> }</p><p>[/code]</p><p></p><p>For the color changer I made it a bit different to see if that would work better as that does register and intialize and loops the color commands which was the most efficient way as that keeps the client 'alive' during the color changes.</p><p>Will publish the code as soon as the repo is created <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="Rick164, post: 1103923, member: 17766"] if the client is already intialized it skips that at the moment: [code] if (client.IsInitialized == false) { client.Initialize(tbHueAppKey.Text); outputtoLog("HUE has been initialized on COLOR CHANGE"); } [/code] And on startup it sets up the connection if an bridge was found: [code] if (string.IsNullOrEmpty(tbHueBridgeIP.Text) == false) { client = new HueClient(hueBridgeIP); client.RegisterAsync(hueAppName, hueAppKey); try { client.Initialize(tbHueAppKey.Text); outputtoLog("HUE has been intialized on STARTUP"); } catch (Exception et) { MessageBox.Show(et.ToString()); } } [/code] For the color changer I made it a bit different to see if that would work better as that does register and intialize and loops the color commands which was the most efficient way as that keeps the client 'alive' during the color changes. Will publish the code as soon as the repo is created :) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
HTPC Projects
Hardware
Ambient Lighting System
Support for Philips Hue System
Contact us
RSS
Top
Bottom