coap-client
wrapper for controlling IKEA TRÅDFRI devices.
coap-client
using the install script.```rs use std::net::Ipv4Addr; use tradfri::gateway::Gateway;
const IP: Ipv4Addr = Ipv4Addr::new(192, 168, 0, 7);
const SECURITY_CODE: &'static str = "
...
let mut gateway = Gateway::new(IP, SECURITY_CODE);
if let Err(err) = gateway.authenticate("
```rs use std::thread; use std::time::Duration;
... let devices = gateway.getdeviceids().unwrap(); println!("{} devices found: {:?}", devices.len(), devices);
let device = gateway.getdeviceby_id(devices[1]).unwrap();
device.turnoff().unwrap(); thread::sleep(Duration::fromsecs(2)); device.turn_on().unwrap(); ```
Incredibly hacky and a work in progress (:
2022 © MIT License