| Crates.io | magichue-rs |
| lib.rs | magichue-rs |
| version | 0.1.0 |
| created_at | 2025-06-27 01:55:20.806158+00 |
| updated_at | 2025-06-27 01:55:20.806158+00 |
| description | Control MagicHue brand Wi-Fi LED bulbs using Rust |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1728060 |
| size | 4,246 |
Control MagicHome/MagicHue Wi-Fi LED smart bulbs in pure Rust.
This crate supports MagicLight Wi-Fi LED Bulbs, which use the MagicHome protocol without checksum verification.
I suggest purchasing that light if you intend to use this library, as I have not tested any others yet, and they are very difficult to find anyways.
use magichue_rs::MagicBulb;
fn main() -> std::io::Result<()> {
let mut bulb = MagicBulb::new("192.168.1.42");
bulb.connect()?;
bulb.turn_on()?;
bulb.set_rgb(255, 0, 128, 200)?; // Pink-ish with 200/255 brightness
bulb.set_ww(128)?; // Set warm white to 50% brightness
bulb.turn_off()?;
Ok(())
}