Checkpoint

This commit is contained in:
Luke Jones
2025-02-08 23:06:02 +13:00
parent 377bb4d6ad
commit 663f87d5e2
24 changed files with 131 additions and 93 deletions

View File

@@ -81,7 +81,7 @@ impl AniMeZbus {
/// Set base brightness level
#[zbus(property)]
async fn brightness(&self) -> Brightness {
if let Ok(config) = self.0.config.try_lock() {
if let Some(config) = self.0.config.try_lock() {
return config.display_brightness;
}
Brightness::Off
@@ -113,7 +113,7 @@ impl AniMeZbus {
#[zbus(property)]
async fn builtins_enabled(&self) -> bool {
if let Ok(config) = self.0.config.try_lock() {
if let Some(config) = self.0.config.try_lock() {
return config.builtin_anims_enabled;
}
false
@@ -158,7 +158,7 @@ impl AniMeZbus {
#[zbus(property)]
async fn builtin_animations(&self) -> Animations {
if let Ok(config) = self.0.config.try_lock() {
if let Some(config) = self.0.config.try_lock() {
return config.builtin_anims;
}
Animations::default()
@@ -191,7 +191,7 @@ impl AniMeZbus {
#[zbus(property)]
async fn enable_display(&self) -> bool {
if let Ok(config) = self.0.config.try_lock() {
if let Some(config) = self.0.config.try_lock() {
return config.display_enabled;
}
false
@@ -214,7 +214,7 @@ impl AniMeZbus {
#[zbus(property)]
async fn off_when_unplugged(&self) -> bool {
if let Ok(config) = self.0.config.try_lock() {
if let Some(config) = self.0.config.try_lock() {
return config.off_when_unplugged;
}
false
@@ -241,7 +241,7 @@ impl AniMeZbus {
#[zbus(property)]
async fn off_when_suspended(&self) -> bool {
if let Ok(config) = self.0.config.try_lock() {
if let Some(config) = self.0.config.try_lock() {
return config.off_when_suspended;
}
false
@@ -257,7 +257,7 @@ impl AniMeZbus {
#[zbus(property)]
async fn off_when_lid_closed(&self) -> bool {
if let Ok(config) = self.0.config.try_lock() {
if let Some(config) = self.0.config.try_lock() {
return config.off_when_lid_closed;
}
false