A long, long time ago, I was watching a Scott Hanselman developer video and he had L.E.D lighting around his office ceiling.
I thought that looked really cool, so like a nerdy little fanboy off I went and bought two sets of GoVee RGBIC LED lighting strips and 25m of conduit to hold them.
I chose GoVee because their strips are wi-fi connected (in addition to Bluetooth), the iPhone app is great and GoVee also has a developer portal so you can issue API calls to control your lights! They also work with Alexa which is another bonus.
I spent about and hour screwing the conduit under the coving that goes around my office ceiling and stuck up the 20m roll of RBIC Led’s.
I was a bit annoyed that the conduit didn’t soften the LEDs into a more solid light bar given the conduit covers were frosted not transparent, but its an acceptable glow.
Next I added the 5m roll under the edge of my desk, for that Fast n Furious neon look!
End result :
I also took the step of signing up to the GoVee API so I could issue HTTP requests to control my lights.
Then, I created Postman tests to change the colours.
Adding these HTTP requests to my personal Azure Dev Ops build piplines to change the colours on a build failure, results in this :
On showing this to one of my work colleagues – Mark Robinson – jokingly named it “Brothel Mode™”, which has stuck making me rename all the YAML tasks in the ADO pipeline to “EnableBrothelMode” when a build fails!
GoVee API use & YAML Pipelines
The GoVee developer site is great, good documentation and their API is super easy to use :
- Sign up, get an API key
They’ll want to know what you’re using it for but integration with ADO seem acceptable! - Add an authorisation header with a key value pair :
key :Govee-API-Key
Value: <Your api key guid from Govee> - Create a queries to control your lights!
Send a GET request tohttp://developer-api.govee.com/v1/devices
to get a list of all your devices, their capabilities and the device ID’s required to issue commands. - Send a PUT request to change the light state!
Include the Authorisation header containing your API key and send a request tohttp://developer-api.govee.com/v1/devices/control
including a JSON body with the command parameters. For example, change the lights to red :
{ "device": "XX:XX:XX:XX:XX:XX:XX:XX", "model": "H6159", "cmd": { "name": "color", "value": { "r": 255, "g": 0, "b": 0 } } }
Control with Azure DevOps
Controlling the lights from an ADO pipeline is also pretty easy once you got the YAML tasks figured out – aka spending a few excruciating hours fiddling with spaces to get it all lined up correctly……stupid yaml spacing nonsense……
- stage: SetBuildLightsToFailure dependsOn: SetupYARNAndBuild condition: failed() jobs: - job: EnableBrothelMode steps: - task: restCallBuildTask@0 displayName: Enable Brothel Mode. inputs: webserviceEndpoint: 'Govee Azure Lights' relativeUrl: httpVerb: 'PUT' body: | { "device": "XX:XX:XX:XX:XX:XX:XX:XX", "model": "H6159", "cmd": { "name": "color", "value": { "r": 255, "g": 0, "b": 0 } } } contentType: 'application/json' headers: '{"Govee-API-Key":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}' allowInvalidSSLCertificate: false
The thing about your entire office glowing read apart from random callers thinking its a room full of cheap hookers, is its an incentive to fix the build really quickly. No one likes sitting in a flaming-hell-box-of-crushed-dreams-and-broken-code.
All in all, a great addition to brighten the office and when there’s no one in the house I turn up the amp, line up some Justin Bieber, and change the lights to disco mode.
#LIVINGMYBESTLIFE