enumify light architype

This commit is contained in:
LordMZTE 2021-10-24 23:27:18 +02:00
parent 3d650cd893
commit 0a42a4fabc
1 changed files with 41 additions and 1 deletions

View File

@ -47,12 +47,52 @@ pub struct Light {
#[derive(Debug, Clone, Deserialize)]
pub struct LightConfig {
pub archetype: String,
pub archetype: LightArchetype,
pub function: String,
pub direction: String,
pub startup: LightStartupConfig,
}
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum LightArchetype {
Bollard,
Candlebulb,
Ceilinground,
Ceilingsquare,
Christmastree,
Classicbulb,
Doublespot,
Flexiblelamp,
Floodbulb,
Floorlantern,
Floorshade,
Groundspot,
Huebloom,
Huecentris,
Huego,
Hueiris,
Huelightstrip,
Huelightstriptv,
Hueplay,
Pendantlong,
Pendantround,
Recessedceiling,
Recessedfloor,
Singlespot,
Spotbulb,
Sultanbulb,
Tableshade,
Tablewash,
Vintagebulb,
Walllantern,
Wallshade,
Wallspot,
#[serde(other)]
Other,
}
#[derive(Debug, Clone, Deserialize)]
pub struct LightStartupConfig {
// TODO: find variants and use enum