Repository navigation
🚨 Breaking change
This release introduces a new, typed API surface and deprecates the previous
map-based interface.
If you are upgrading from v0.1.x, please read BREAKING_CHANGES.md before
upgrading.
✨ What’s new
Typed API
- Devices are now returned as
%GoveeLights.Device{}structs - Device state is normalized into
%GoveeLights.Device.State{} - All fields are validated at construction time
Explicit error handling
- All public API calls return
{:ok, value} | {:error, reason} - Bang variants (
devices!/0, etc.) raiseGoveeLights.Api.Error - Errors carry structured reasons (transport, decode, validation)
Safer command execution
- Command helpers validate inputs before sending requests
- Transport errors are consistently tagged as
{:http_error, reason}
🆕 New API entrypoint
All interactions now go through:
GoveeLights.ApiThe old top-level functions remain deprecated and will be removed in a
future release.
🔄 Migration example
Before (v0.1.x)
devices = GoveeLights.devices()
device = hd(devices)
GoveeLights.turn_on(device["device"], device["model"])After (v0.2.0)
{:ok, devices} = GoveeLights.Api.devices()
%Device{id: id, model: model} = hd(devices)
:ok = GoveeLights.Api.turn_on(id, model)📚 Documentation
- Full API docs: https://hexdocs.pm/govee_lights
- Migration notes: BREAKING_CHANGES.md
Thanks to everyone using and testing the library ❤️