Video: Improving a GenServer, My IoT Lightswitch

Underjord is an artisanal consultancy doing consulting in Elixir, Nerves with an accidental speciality in marketing and outreach. If you like the writing you should really try the pro version.

GenServer is the typical Actor abstraction in Erlang and Elixir. I’ve used one for talking to my Elgato Keylights in the lightswitch project. I made it sort of dumb.

It was a quick job so I want to improve it in a few ways.

  • Make it not need to pull the new state from lights before sending commands.
  • Pull state in the background occasionally to keep relatively up-to-date.
  • Always fetch status after sending commands.
  • If there is time, improve the lighting on the keybow to represent the state of the lights.

Spoiler, most of it got done during the stream :)

4K HD 720 low

Underjord is an artisanal consultancy doing consulting in Elixir, Nerves with an accidental speciality in marketing and outreach. If you like the writing you should really try the pro version.

Note: Or try the videos on the YouTube channel.