removed legacy code and clippy fixes + fixed ci
Release / Build and Release (push) Failing after 38s

This commit is contained in:
2026-04-01 14:01:16 +02:00
parent bd18bbf866
commit 7a8f70938e
9 changed files with 22 additions and 61 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
cache: false cache: false
- name: Install packaging tools - name: Install packaging tools
run: apt-get update && apt-get install -y dpkg-dev run: apt-get update && apt-get install -y dpkg-dev pkg-config
- name: Get Version - name: Get Version
id: get_version id: get_version
Generated
+1 -1
View File
@@ -353,7 +353,7 @@ checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99"
[[package]] [[package]]
name = "fluxo-rs" name = "fluxo-rs"
version = "0.2.0" version = "0.3.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bluer", "bluer",
-18
View File
@@ -26,8 +26,6 @@ pub struct Config {
#[serde(default)] #[serde(default)]
pub power: PowerConfig, pub power: PowerConfig,
#[serde(default)] #[serde(default)]
pub buds: BudsConfig,
#[serde(default)]
pub audio: AudioConfig, pub audio: AudioConfig,
#[serde(default)] #[serde(default)]
pub bt: BtConfig, pub bt: BtConfig,
@@ -158,21 +156,6 @@ impl Default for PowerConfig {
} }
} }
#[derive(Deserialize)]
pub struct BudsConfig {
pub format: String,
pub format_disconnected: String,
}
impl Default for BudsConfig {
fn default() -> Self {
Self {
format: "{left} | {right} | {anc}".to_string(),
format_disconnected: "<span size='large'></span>".to_string(),
}
}
}
#[derive(Deserialize)] #[derive(Deserialize)]
pub struct AudioConfig { pub struct AudioConfig {
pub format_sink_unmuted: String, pub format_sink_unmuted: String,
@@ -275,7 +258,6 @@ impl Config {
validate_format("disk", &self.disk.format, &["mount", "used", "total"]); validate_format("disk", &self.disk.format, &["mount", "used", "total"]);
validate_format("pool", &self.pool.format, &["used", "total"]); validate_format("pool", &self.pool.format, &["used", "total"]);
validate_format("power", &self.power.format, &["percentage", "icon"]); validate_format("power", &self.power.format, &["percentage", "icon"]);
validate_format("buds", &self.buds.format, &["left", "right", "anc"]);
validate_format( validate_format(
"audio.sink_unmuted", "audio.sink_unmuted",
&self.audio.format_sink_unmuted, &self.audio.format_sink_unmuted,
+8 -11
View File
@@ -123,15 +123,13 @@ fn main() {
let mut items = Vec::new(); let mut items = Vec::new();
// If connected, show plugin modes and disconnect // If connected, show plugin modes and disconnect
if let Ok(json_str) = ipc::request_data("bt", &["get_modes"]) { if let Ok(json_str) = ipc::request_data("bt", &["get_modes"])
if let Ok(val) = serde_json::from_str::<serde_json::Value>(&json_str) { && let Ok(val) = serde_json::from_str::<serde_json::Value>(&json_str)
if let Some(modes_str) = val.get("text").and_then(|t| t.as_str()) { && let Some(modes_str) = val.get("text").and_then(|t| t.as_str())
if !modes_str.is_empty() { && !modes_str.is_empty()
for mode in modes_str.lines() { {
items.push(format!("Mode: {}", mode)); for mode in modes_str.lines() {
} items.push(format!("Mode: {}", mode));
}
}
} }
} }
@@ -166,8 +164,7 @@ fn main() {
if let Ok(selected) = if let Ok(selected) =
utils::show_menu("BT Menu: ", &items, &config.general.menu_command) utils::show_menu("BT Menu: ", &items, &config.general.menu_command)
{ {
if selected.starts_with("Mode: ") { if let Some(mode) = selected.strip_prefix("Mode: ") {
let mode = &selected[6..];
handle_ipc_response(ipc::request_data("bt", &["set_mode", mode])); handle_ipc_response(ipc::request_data("bt", &["set_mode", mode]));
} else if selected == "Disconnect" { } else if selected == "Disconnect" {
handle_ipc_response(ipc::request_data("bt", &["disconnect"])); handle_ipc_response(ipc::request_data("bt", &["disconnect"]));
+2 -2
View File
@@ -121,7 +121,7 @@ fn fetch_audio_data_sync(context: &mut Context, state: &SharedState) -> Result<(
let is_default = item let is_default = item
.name .name
.as_ref() .as_ref()
.map(|s| s.to_string() == lock.audio.sink.name) .map(|s| s.as_ref() == lock.audio.sink.name)
.unwrap_or(false); .unwrap_or(false);
if is_default { if is_default {
lock.audio.sink.description = item lock.audio.sink.description = item
@@ -143,7 +143,7 @@ fn fetch_audio_data_sync(context: &mut Context, state: &SharedState) -> Result<(
let is_default = item let is_default = item
.name .name
.as_ref() .as_ref()
.map(|s| s.to_string() == lock.audio.source.name) .map(|s| s.as_ref() == lock.audio.source.name)
.unwrap_or(false); .unwrap_or(false);
if is_default { if is_default {
lock.audio.source.description = item lock.audio.source.description = item
+4 -5
View File
@@ -226,12 +226,11 @@ async fn buds_task(
if let Ok(val) = service if let Ok(val) = service
.read_setting_var(settings::SettingId::CurrentAncrState) .read_setting_var(settings::SettingId::CurrentAncrState)
.await .await
&& let SettingValue::CurrentAncrState(anc_state) = val
{ {
if let SettingValue::CurrentAncrState(anc_state) = val { let mut status = MAESTRO.get_status(mac);
let mut status = MAESTRO.get_status(mac); status.anc_state = anc_state_to_string(&anc_state);
status.anc_state = anc_state_to_string(&anc_state); statuses.lock().unwrap().insert(mac.to_string(), status);
statuses.lock().unwrap().insert(mac.to_string(), status);
}
} }
// Subscribe to real-time status updates (battery, ANC, wear) // Subscribe to real-time status updates (battery, ANC, wear)
+5 -6
View File
@@ -175,12 +175,11 @@ fn get_primary_interface() -> Result<String> {
fn get_ip_address(interface: &str) -> Option<String> { fn get_ip_address(interface: &str) -> Option<String> {
let addrs = getifaddrs().ok()?; let addrs = getifaddrs().ok()?;
for ifaddr in addrs { for ifaddr in addrs {
if ifaddr.interface_name == interface { if ifaddr.interface_name == interface
if let Some(address) = ifaddr.address { && let Some(address) = ifaddr.address
if let Some(sockaddr) = address.as_sockaddr_in() { && let Some(sockaddr) = address.as_sockaddr_in()
return Some(sockaddr.ip().to_string()); {
} return Some(sockaddr.ip().to_string());
}
} }
} }
None None
+1 -12
View File
@@ -1,6 +1,6 @@
use serde::Serialize; use serde::Serialize;
#[derive(Serialize)] #[derive(Serialize, Default)]
pub struct WaybarOutput { pub struct WaybarOutput {
pub text: String, pub text: String,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@@ -11,17 +11,6 @@ pub struct WaybarOutput {
pub percentage: Option<u8>, pub percentage: Option<u8>,
} }
impl Default for WaybarOutput {
fn default() -> Self {
Self {
text: String::new(),
tooltip: None,
class: None,
percentage: None,
}
}
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
-5
View File
@@ -1,5 +0,0 @@
use pbpctrl::Controller;
fn main() {
let _ = Controller::connect("AA:BB:CC:DD:EE:FF");
}