DEV Community

Vasu Jain
Vasu Jain

Posted on • Updated on

Github Workflow to change Smart Bulb color to RED on Pull Request

Change lightings on a Pull request in Github (or a Push request)

We all get very busy while focusing on fixing that bug or building a new feature but what if something as urgent as a code push or a pull request comes your way.

Red Bulb

This workflow which talks to your IOT devices in this specific implementation LIFX Smart bulbs, does notify certain actions on Github by changing bulb color.

This Github Workflow changes Smart Bulb color to RED on Pull Request (and Green on Merge - This part is WIP)

Future integration in progreas:

  1. Changing Yellow color for the bulb on merge conflict event
  2. Applause or cheers sent via Alexa as a speaker (Alexa push voice capability)
  3. Brew coffee using the IOT smart plugs (TP link/Wyze etc)

This was the most basic implementation we could do in whatever time we could get for this hackathon. (The entire team spent close to 4-5 hours only to bring it in this state)

Submission Category:

DIY Deployments, Interesting IoT, Phone Friendly, Wacky Wildcards

Yaml File and Link to Code

Link to Code

Please feel free to check it, fork it and ask me anything, here is the repo:

step to run on local machine's IntellJ:

Main Class: io.vertx.core.Launcher

VM Options: -Dvertx.options.maxEventLoopExecuteTime=100000000000000

Program Arguments: run -conf config/application-config.json

Module: rest

For Dev hack :

Yaml File

# Workflow to help you get started with Actions

name: CI

# Control when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch (push/pull)
    branches:  master
    branches:  master

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
  # This workflow contains a single job called "build"
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      # Runs a single command using the runners shell
      - name: Run a one-line script
        run: echo Running Github Workflow for Push/Pull!

      # Runs a set of commands using the runners shell
      - name: Run a multi-line script
        run: |
          echo Add other actions to build,
          echo test, and deploy your project.

      - name: Hit curl
        uses: wei/curl@master

Additional Resources / Info

Vasu Jain (Product, Architect, Dev)
Pranav Saxena (Lead Developer)

Discussion (4)

pooran profile image
Pooran Prasad Rajanna

This is a good idea!

rjvm profile image
RJ-vm • Edited on

This can bring so much fun to work.
It can be adapted into a game to increase employer engagement or improve team bonding.
Another application for it which has immense scope is edutainment industry.

vj profile image
Vasu Jain Author

oh great suggestions. Thanks a lot.

accodestar profile image

How cool! @vj is there a short video to see how it works ?