diff --git a/orb-ui/rgb/src/lib.rs b/orb-ui/rgb/src/lib.rs index 4f3095b0..3353b527 100644 --- a/orb-ui/rgb/src/lib.rs +++ b/orb-ui/rgb/src/lib.rs @@ -79,6 +79,11 @@ impl Argb { Argb(Some(Self::DIMMING_MAX_VALUE), 128, 128, 0); pub const DIAMOND_OPERATOR_VERSIONS_OUTDATED: Argb = Argb(Some(Self::DIMMING_MAX_VALUE), 255, 0, 0); + + /// Outer-ring color during wifi QR scans + pub const DIAMOND_RING_WIFI_QR_SCAN: Argb = Argb(Some(5), 0, 10, 80); + pub const DIAMOND_RING_WIFI_QR_SCAN_SPINNER: Argb = Argb(Some(10), 50, 50, 40); + /// Outer-ring color during operator QR scans pub const DIAMOND_RING_OPERATOR_QR_SCAN: Argb = Argb(Some(5), 77, 14, 0); pub const DIAMOND_RING_OPERATOR_QR_SCAN_SPINNER: Argb = Argb(Some(10), 80, 50, 30); diff --git a/orb-ui/src/engine/diamond.rs b/orb-ui/src/engine/diamond.rs index a6b4e39c..9bd6b720 100644 --- a/orb-ui/src/engine/diamond.rs +++ b/orb-ui/src/engine/diamond.rs @@ -247,6 +247,11 @@ impl EventHandler for Runner { sound::Type::Melody(sound::Melody::InternetConnectionSuccessful), Duration::ZERO, )?; + self.stop_ring(LEVEL_FOREGROUND, Transition::FadeOut(0.5)); + self.set_ring( + LEVEL_BACKGROUND, + animations::Static::::new(Argb::OFF, None), + ); } Event::BootComplete { api_mode } => { self.sound.queue( @@ -345,7 +350,14 @@ impl EventHandler for Runner { } QrScanSchema::Wifi => { self.operator_idle.no_wlan(); - + self.set_ring( + LEVEL_FOREGROUND, + animations::SimpleSpinner::new( + Argb::DIAMOND_RING_WIFI_QR_SCAN_SPINNER, + Some(Argb::DIAMOND_RING_WIFI_QR_SCAN), + ) + .fade_in(1.5), + ); // temporarily increase the volume to ask wifi qr code let master_volume = self.sound.volume(); self.sound.set_master_volume(40); @@ -488,6 +500,7 @@ impl EventHandler for Runner { ); } QrScanSchema::Wifi => { + self.stop_ring(LEVEL_FOREGROUND, Transition::FadeOut(0.5)); self.sound.queue( sound::Type::Melody(sound::Melody::QrLoadSuccess), Duration::ZERO, diff --git a/orb-ui/src/simulation.rs b/orb-ui/src/simulation.rs index 506bb5be..55486533 100644 --- a/orb-ui/src/simulation.rs +++ b/orb-ui/src/simulation.rs @@ -41,6 +41,15 @@ pub async fn bootup_simulation(ui: &dyn Engine) -> Result<()> { Ok(()) } +#[expect(dead_code)] +pub async fn wifi_qr_code_simulation(ui: &dyn Engine) { + ui.qr_scan_start(QrScanSchema::Wifi); + time::sleep(Duration::from_secs(6)).await; + ui.qr_scan_capture(); + time::sleep(Duration::from_secs(2)).await; + ui.network_connection_success(); +} + pub async fn signup_simulation( ui: &dyn Engine, hardware: Hardware,