ridiculous refactor to allow enums to be dbus strings for better TS generation

This commit is contained in:
Luke D. Jones
2023-06-27 21:16:13 +12:00
parent fca7d23a31
commit 7b17a13ce7
43 changed files with 1516 additions and 267 deletions

View File

@@ -21,13 +21,41 @@ pub mod usb;
pub const LED_MSG_LEN: usize = 17;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const RED: Colour = Colour(0xff, 0x00, 0x00);
pub const GREEN: Colour = Colour(0x00, 0xff, 0x00);
pub const BLUE: Colour = Colour(0x00, 0x00, 0xff);
pub const VIOLET: Colour = Colour(0x9b, 0x26, 0xb6);
pub const TEAL: Colour = Colour(0x00, 0x7c, 0x80);
pub const YELLOW: Colour = Colour(0xff, 0xef, 0x00);
pub const ORANGE: Colour = Colour(0xff, 0xa4, 0x00);
pub const RED: Colour = Colour {
r: 0xff,
g: 0x00,
b: 0x00,
};
pub const GREEN: Colour = Colour {
r: 0x00,
g: 0xff,
b: 0x00,
};
pub const BLUE: Colour = Colour {
r: 0x00,
g: 0x00,
b: 0xff,
};
pub const VIOLET: Colour = Colour {
r: 0x9b,
g: 0x26,
b: 0xb6,
};
pub const TEAL: Colour = Colour {
r: 0x00,
g: 0x7c,
b: 0x80,
};
pub const YELLOW: Colour = Colour {
r: 0xff,
g: 0xef,
b: 0x00,
};
pub const ORANGE: Colour = Colour {
r: 0xff,
g: 0xa4,
b: 0x00,
};
pub const GRADIENT: [Colour; 7] = [RED, VIOLET, BLUE, TEAL, GREEN, YELLOW, ORANGE];
#[derive(Debug, Clone, PartialEq, Eq, Default, serde::Deserialize, serde::Serialize)]