wled-json: Convenient interface for interacting with WLED devices

[ bsd3, interfaces, library, program ] [ Propose Tags ] [ Report a vulnerability ]

Please see the README on GitHub at https://github.com/alaendle/wled-json#readme


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1.0
Change log CHANGELOG.md
Dependencies aeson (>=2.2.3 && <2.3), barbies (>=2.0.5 && <2.2), base (>=4.7 && <5), bytestring (>=0.11.5.3 && <0.13), deriving-aeson (>=0.2.9 && <0.3), http-conduit (>=2.3.9.1 && <2.4), rhine (>=1.4.0.1 && <1.6), wled-json [details]
License BSD-3-Clause
Copyright 2024 Andreas Ländle
Author Andreas Ländle
Maintainer Andreas Ländle
Category Interfaces
Home page https://github.com/alaendle/wled-json#readme
Bug tracker https://github.com/alaendle/wled-json/issues
Source repo head: git clone https://github.com/alaendle/wled-json
Uploaded by alaendle at 2024-12-02T18:43:49Z
Distributions LTSHaskell:0.0.1.0
Executables wled-json-exe
Downloads 18 total (18 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-12-02 [all 1 reports]

Readme for wled-json-0.0.1.0

[back to package description]

wled-json ✨

Haskell bindings for controlling WLED devices, with a focus on Octolamps

Octolamp showing french flag

Introduction 💡

This Haskell library provides a convenient interface for interacting with WLED devices, particularly those based on the popular Octolamp design. It leverages the WLED API (https://kno.wled.ge/) to allow you to control various aspects of your LED lights, including:

  • Color: Set the color of your lights using various color spaces (RGB, HSV, etc.)
  • Brightness: Adjust the overall brightness of your lights

Installation ⚙️

# Using cabal
cabal add wled-json

# Using stack
stack add wled-json

Usage 📲

import           Control.Concurrent
import           WLED.Device
import           WLED.Octocat.Flags (france)
import           WLED.Types

main :: IO ()
main = do
    -- Connect to a WLED device
    lampState <- getLampState wledUrl
    case lampState of
        Left errMsg -> putStrLn errMsg
        Right initialState -> do
            -- Display the French flag on an Octolamp
            _ <- setLampState wledUrl france

            -- Just sleep one second
            threadDelay 1000000
            
            -- Restore the initial state
            Right currentState <- getLampState wledUrl
            _ <- setLampState wledUrl (diff currentState initialState)
            pure ()
  where
    wledUrl = "http://192.168.178.34"

Features 👍

  • Comprehensive WLED API coverage
  • Type-safe interactions
  • Easy-to-use API
  • Specific support for Octolamps

Contributing 🤝

Contributions are welcome! Please feel free to open an issue or submit a pull request.

License ✌️

BSD-3-Clause