int3 Posted February 27, 2019 Share Posted February 27, 2019 I created a simple plugin to integrate launchbox/bigbox with my yeelight rgb. It kind of simulates a backlight (I have the bulb behind the tv) but I think it looks better, for this case at least The light turn on when I start bigbox, change the color based on selectedgame -> platform and turn off when I exit.. Here's how it looks right now I don't plan in doing a public release but I can share the code if anyone gets interested. 3 Quote Link to comment Share on other sites More sharing options...
srxz Posted February 27, 2019 Share Posted February 27, 2019 would be nice to have the code Quote Link to comment Share on other sites More sharing options...
DerSchlachter Posted February 27, 2019 Share Posted February 27, 2019 12 hours ago, int3 said: but I can share the code if anyone gets interested. Of course ? Quote Link to comment Share on other sites More sharing options...
int3 Posted February 28, 2019 Author Share Posted February 28, 2019 (edited) Ok first let me say I'm doing everything the lazy way docs -> https://www.yeelight.com/download/Yeelight_Inter-Operation_Spec.pdf - you have to activate lan control from the app - the lamp will listen on 55443 for raw tcp json commands (NOT http) (philips hue, for example, you send commands via http post) the recommended way to start would be doing an SSDP discover on your network to get info about the lamp(s) (ip/port/etc). I'm just hardcoding the ip I get from the app/router. I'm also not checking for any server replies so I had to put that sleep on shutdown, because it was disconnecting before powering off :x BigLight.cs Edited February 28, 2019 by int3 Quote Link to comment Share on other sites More sharing options...
int3 Posted February 28, 2019 Author Share Posted February 28, 2019 Maybe I'll do a full plugin with a revised code after all 1 1 Quote Link to comment Share on other sites More sharing options...
int3 Posted March 3, 2019 Author Share Posted March 3, 2019 @Jason Carr hey jason is there any way to get the platform selected from the platforms menu? I'm getting the platform from the game with SystemEventTypes.SelectionChanged -> GetAllSelectedGames()[0].Platform but I wanted to change colors from the platforms menu Looking at the api I see IBigBoxThemeElementPlugin.OnSelectionChanged but it doesn't seem to be firing or maybe I'm doing something wrong (not sure if I'd have to handle OnUp(), OnDown(), etc) The idea is when I open BigBox or go to "View Platforms" get the currently selected platform, and when I move up or down get the newly selected, etc. Thank you Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted March 4, 2019 Share Posted March 4, 2019 This looks amazing @int3; what an awesome idea. The IBigBoxThemeElementPlugin.OnSelectionChanged sounds like the right way to go. Basically, you'd have to implement that interface, and yes, you'd have to add methods for each of those methods on the interface, but you could just make them do nothing. If you implement that interface on a new class, it should be firing. Let me know if you can't get it to work and post the code and I'll help get it figured out. 1 Quote Link to comment Share on other sites More sharing options...
int3 Posted March 5, 2019 Author Share Posted March 5, 2019 @Jason Carr glad you like it. I'm attaching a small code I tried now, it only generates the log for the SystemEvent :X BigBoxPluginsTest.cs Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted March 8, 2019 Share Posted March 8, 2019 @int3 I *think* I know why. In order to use the IBigBoxThemeElementPlugin interface, you have to implement it from a WPF/XAML control, and then use that control in a custom theme. That was the point of that type of plugin when it was built. If you're looking to do it without a custom theme, you would need to use one of the other interfaces, such as the ISystemEventsPlugin, as you've done. Is there a reason why that won't work? Quote Link to comment Share on other sites More sharing options...
int3 Posted March 8, 2019 Author Share Posted March 8, 2019 @Jason Carr only problem in using SystemEventTypes.SelectionChanged is I don't have a way to get the currently selected platform (from the platforms view). It fires when I open BigBox and when I move up or down, but since there's no game selected I can't use PluginHelper.StateManager.GetAllSelectedGames()[0].Platform. Maybe if you add a GetSelectedPlatform() to StateManager? Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted March 18, 2019 Share Posted March 18, 2019 On 3/8/2019 at 1:02 PM, int3 said: @Jason Carr only problem in using SystemEventTypes.SelectionChanged is I don't have a way to get the currently selected platform (from the platforms view). It fires when I open BigBox and when I move up or down, but since there's no game selected I can't use PluginHelper.StateManager.GetAllSelectedGames()[0].Platform. Maybe if you add a GetSelectedPlatform() to StateManager? @int3 Sorry for the delay on this, but I've actually added a new StateManager.GetSelectedPlatform() method in for the next beta. I'm not exactly sure when the beta will be out, but most likely it'll be out in the next few days. 1 Quote Link to comment Share on other sites More sharing options...
zetec-s-joe Posted April 22, 2019 Share Posted April 22, 2019 Once the you have updated int3 show a new video Joe Quote Link to comment Share on other sites More sharing options...
int3 Posted May 2, 2019 Author Share Posted May 2, 2019 On 4/22/2019 at 4:25 PM, zetec-s-joe said: Once the you have updated int3 show a new video Joe I think @Jason Carr forgot to add GetSelectedPlatform(). I'm on 9.8-beta-10 and cannot see the method :X But when it gets added I'll post a new video 1 Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted May 3, 2019 Share Posted May 3, 2019 19 hours ago, int3 said: I think @Jason Carr forgot to add GetSelectedPlatform(). I'm on 9.8-beta-10 and cannot see the method :X But when it gets added I'll post a new video Whoops. So I added it in, but forgot to add it to the interface itself. Fixed that for the next beta. 1 Quote Link to comment Share on other sites More sharing options...
zetec-s-joe Posted May 4, 2019 Share Posted May 4, 2019 Looking foward to seeing this in action Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.