diff --git a/src/directb2s/mod.rs b/src/directb2s/mod.rs index 79e77db..d88beb8 100644 --- a/src/directb2s/mod.rs +++ b/src/directb2s/mod.rs @@ -123,6 +123,8 @@ pub struct AnimationStep { pub off: String, #[serde(rename = "@WaitLoopsAfterOff")] pub wait_loops_after_off: String, + #[serde(rename = "@PulseSwitch", skip_serializing_if = "Option::is_none")] + pub pulse_switch: Option, } #[derive(Debug, Deserialize, Serialize)] @@ -139,6 +141,10 @@ pub struct Animation { pub loops: String, #[serde(rename = "@IDJoin")] pub id_join: String, + #[serde(rename = "@RandomQuality", skip_serializing_if = "Option::is_none")] + pub random_quality: Option, + #[serde(rename = "@RandomStart", skip_serializing_if = "Option::is_none")] + pub random_start: Option, #[serde(rename = "@StartAnimationAtBackglassStartup")] pub start_animation_at_backglass_startup: String, #[serde( @@ -169,8 +175,8 @@ pub struct Animation { skip_serializing_if = "Option::is_none" )] pub run_animation_til_end: Option, - #[serde(rename = "AnimationStep")] - pub animation_step: Vec, + #[serde(rename = "AnimationStep", skip_serializing_if = "Option::is_none")] + pub animation_step: Option>, } #[derive(Debug, Deserialize, Serialize)] @@ -466,6 +472,18 @@ pub struct DMDDefaultLocation { pub loc_y: String, } +#[derive(Debug, Deserialize, Serialize)] +pub struct VRDMDLocation { + #[serde(rename = "@LocX")] + pub loc_x: String, + #[serde(rename = "@LocY")] + pub loc_y: String, + #[serde(rename = "@Width")] + pub width: String, + #[serde(rename = "@Height")] + pub height: String, +} + #[derive(Debug, Deserialize, Serialize)] pub struct GrillHeight { #[serde(rename = "@Value")] @@ -487,6 +505,8 @@ pub struct DirectB2SData { pub dmd_type: DmdTypeTag, #[serde(rename = "DMDDefaultLocation")] pub dmd_default_location: DMDDefaultLocation, + #[serde(rename = "VRDMDLocation", skip_serializing_if = "Option::is_none")] + pub vr_dmd_location: Option, #[serde(rename = "GrillHeight")] pub grill_height: GrillHeight, #[serde(rename = "ProjectGUID")] diff --git a/tests/directb2s_read_write_compare_all.rs b/tests/directb2s_read_write_compare_all.rs index 1602bbb..e56b571 100644 --- a/tests/directb2s_read_write_compare_all.rs +++ b/tests/directb2s_read_write_compare_all.rs @@ -137,7 +137,7 @@ fn write_node( a.name(), &value.len(), calculate_hash(&value), - &value[0..100] + value.chars().take(100).collect::() ) } else { format!("{}={}", a.name(), a.value())