properties: rewrite properties (whoops)

This commit is contained in:
Torrie Fischer
2024-12-15 19:27:27 +01:00
parent 3a49e7e390
commit 514c9defd6
19 changed files with 1051 additions and 715 deletions

View File

@@ -1,11 +1,12 @@
use smart_leds_trait::SmartLedsWrite;
use crate::buffers::Pixbuf;
use crate::events::Variant;
use crate::render::{HardwarePixel, Output, PixelView, Sample};
use crate::properties::Variant;
use crate::render::{HardwarePixel, Output, PixelView, Sample, props::Output as OutputNS};
use crate::power::brightness_for_mw;
use crate::geometry::*;
use crate::{geometry::*, prop_id};
use crate::mappings::*;
use paste::paste;
use core::fmt::Debug;
@@ -57,7 +58,7 @@ impl<P: Pixbuf<Pixel=T::Color>, T: FastWrite> Output for StrideOutput<P, T> {
fn on_event(&mut self, event: &crate::events::Event) {
match event {
crate::events::Event::PropertyChange("output.brightness", Variant::Byte(new_brightness)) => self.brightness = *new_brightness,
crate::events::Event::PropertyChange(prop_id!(OutputNS::Brightness), Variant::Byte(new_brightness)) => self.brightness = *new_brightness,
_ => ()
}
}