medius 3.4.6

Rust library for Medius, replacement firmware for the MAKCU box
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::error::Result;
use crate::protocol::FrameType;
use crate::protocol::command::led_payload;
use crate::types::{LedMode, LedTarget};

use super::Device;

impl Device {
    /// `LED`: override a status LED (off, solid or blink at `level` brightness).
    ///
    /// [`LedMode::Auto`] returns the LED to the box's status display. Fire-and-forget.
    pub fn led(&self, target: LedTarget, mode: LedMode, level: u8) -> Result<()> {
        self.link.send(
            FrameType::Led,
            &led_payload(target.as_u8(), mode.as_u8(), level),
        )
    }
}