mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
Update deps
This commit is contained in:
@@ -10,7 +10,9 @@ use rog_anime::usb::{
|
||||
};
|
||||
use rog_anime::{Animations, AnimeDataBuffer, DeviceState};
|
||||
use zbus::export::futures_util::lock::Mutex;
|
||||
use zbus::{interface, CacheProperties, Connection, SignalContext};
|
||||
use zbus::object_server::SignalEmitter;
|
||||
use zbus::proxy::CacheProperties;
|
||||
use zbus::{interface, Connection};
|
||||
|
||||
use super::config::AnimeConfig;
|
||||
use super::CtrlAnime;
|
||||
@@ -297,7 +299,7 @@ impl crate::CtrlTask for CtrlAnimeZbus {
|
||||
ANIME_ZBUS_PATH
|
||||
}
|
||||
|
||||
async fn create_tasks(&self, _: SignalContext<'static>) -> Result<(), RogError> {
|
||||
async fn create_tasks(&self, _: SignalEmitter<'static>) -> Result<(), RogError> {
|
||||
let inner1 = self.0.clone();
|
||||
let inner2 = self.0.clone();
|
||||
let inner3 = self.0.clone();
|
||||
|
||||
@@ -187,7 +187,7 @@ impl AuraConfig {
|
||||
for enabled_init in &mut config_init.enabled.states {
|
||||
for enabled in &mut config_loaded.enabled.states {
|
||||
if enabled.zone == enabled_init.zone {
|
||||
*enabled_init = enabled.clone();
|
||||
*enabled_init = *enabled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use log::{error, info, warn};
|
||||
use mio::{Events, Interest, Poll, Token};
|
||||
use tokio::task::spawn_blocking;
|
||||
use udev::{Device, MonitorBuilder};
|
||||
use zbus::object_server::SignalContext;
|
||||
use zbus::object_server::SignalEmitter;
|
||||
use zbus::zvariant::{ObjectPath, OwnedObjectPath};
|
||||
use zbus::Connection;
|
||||
|
||||
@@ -119,7 +119,7 @@ pub(crate) fn dbus_path_for_tuf() -> OwnedObjectPath {
|
||||
pub async fn start_tasks(
|
||||
mut zbus: CtrlAuraZbus,
|
||||
connection: Connection,
|
||||
_signal_ctx: SignalContext<'static>,
|
||||
_signal_ctx: SignalEmitter<'static>,
|
||||
path: OwnedObjectPath,
|
||||
) -> Result<(), RogError> {
|
||||
// let task = zbus.clone();
|
||||
|
||||
@@ -8,7 +8,8 @@ use rog_aura::{AuraDeviceType, AuraEffect, AuraModeNum, AuraZone, LedBrightness,
|
||||
use zbus::export::futures_util::lock::{Mutex, MutexGuard};
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
use zbus::fdo::Error as ZbErr;
|
||||
use zbus::{interface, SignalContext};
|
||||
use zbus::interface;
|
||||
use zbus::object_server::SignalEmitter;
|
||||
|
||||
use super::controller::CtrlKbdLed;
|
||||
use crate::error::RogError;
|
||||
@@ -18,10 +19,10 @@ pub const AURA_ZBUS_NAME: &str = "Aura";
|
||||
pub const AURA_ZBUS_PATH: &str = "/org/asuslinux";
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct CtrlAuraZbus(Arc<Mutex<CtrlKbdLed>>, SignalContext<'static>);
|
||||
pub struct CtrlAuraZbus(Arc<Mutex<CtrlKbdLed>>, SignalEmitter<'static>);
|
||||
|
||||
impl CtrlAuraZbus {
|
||||
pub fn new(controller: CtrlKbdLed, signal: SignalContext<'static>) -> Self {
|
||||
pub fn new(controller: CtrlKbdLed, signal: SignalEmitter<'static>) -> Self {
|
||||
Self(Arc::new(Mutex::new(controller)), signal)
|
||||
}
|
||||
|
||||
@@ -115,7 +116,7 @@ impl CtrlAuraZbus {
|
||||
}
|
||||
ctrl.config.write();
|
||||
|
||||
self.led_mode_data_invalidate(&self.1).await.ok();
|
||||
self.led_mode_data_changed(&self.1).await.ok();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -157,7 +158,7 @@ impl CtrlAuraZbus {
|
||||
ctrl.config.set_builtin(effect);
|
||||
ctrl.config.write();
|
||||
|
||||
self.led_mode_invalidate(&self.1).await.ok();
|
||||
self.led_mode_changed(&self.1).await.ok();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -211,7 +212,7 @@ impl CtrlTask for CtrlAuraZbus {
|
||||
"/org/asuslinux"
|
||||
}
|
||||
|
||||
async fn create_tasks(&self, _: SignalContext<'static>) -> Result<(), RogError> {
|
||||
async fn create_tasks(&self, _: SignalEmitter<'static>) -> Result<(), RogError> {
|
||||
let load_save =
|
||||
|start: bool, mut lock: MutexGuard<'_, CtrlKbdLed>| -> Result<(), RogError> {
|
||||
// If waking up
|
||||
|
||||
@@ -10,7 +10,8 @@ use rog_profiles::fan_curve_set::CurveData;
|
||||
use rog_profiles::{find_fan_curve_node, FanCurvePU, FanCurveProfiles};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::sync::Mutex;
|
||||
use zbus::{interface, Connection, SignalContext};
|
||||
use zbus::object_server::SignalEmitter;
|
||||
use zbus::{interface, Connection};
|
||||
|
||||
use crate::error::RogError;
|
||||
use crate::{CtrlTask, CONFIG_PATH_BASE};
|
||||
@@ -234,7 +235,7 @@ impl CtrlTask for CtrlFanCurveZbus {
|
||||
FAN_CURVE_ZBUS_PATH
|
||||
}
|
||||
|
||||
async fn create_tasks(&self, _signal_ctxt: SignalContext<'static>) -> Result<(), RogError> {
|
||||
async fn create_tasks(&self, _signal_ctxt: SignalEmitter<'static>) -> Result<(), RogError> {
|
||||
let watch_throttle_thermal_policy = self.platform.monitor_throttle_thermal_policy()?;
|
||||
let platform = self.platform.clone();
|
||||
let config = self.config.clone();
|
||||
|
||||
@@ -10,7 +10,8 @@ use rog_platform::platform::{GpuMode, Properties, RogPlatform, ThrottlePolicy};
|
||||
use rog_platform::power::AsusPower;
|
||||
use zbus::export::futures_util::lock::Mutex;
|
||||
use zbus::fdo::Error as FdoErr;
|
||||
use zbus::{interface, Connection, SignalContext};
|
||||
use zbus::object_server::SignalEmitter;
|
||||
use zbus::{interface, Connection};
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::error::RogError;
|
||||
@@ -44,7 +45,7 @@ macro_rules! platform_set_value {
|
||||
concat_idents::concat_idents!(set = set_, $property {
|
||||
$self.platform.set($new_value).map_err(|err| {
|
||||
error!("RogPlatform: {} {err}", $prop_name);
|
||||
FdoErr::NotSupported(format!("RogPlatform: {} {err}", $prop_name))
|
||||
FdoErr::Failed(format!("RogPlatform: {} {err}", $prop_name))
|
||||
})?;
|
||||
});
|
||||
let mut lock = $self.config.lock().await;
|
||||
@@ -93,7 +94,7 @@ impl CtrlPlatform {
|
||||
pub fn new(
|
||||
config: Arc<Mutex<Config>>,
|
||||
config_path: &Path,
|
||||
signal_context: SignalContext<'static>,
|
||||
signal_context: SignalEmitter<'static>,
|
||||
) -> Result<Self, RogError> {
|
||||
// let attrs = FirmwareAttributes::new();
|
||||
let platform = RogPlatform::new()?;
|
||||
@@ -384,7 +385,7 @@ impl CtrlPlatform {
|
||||
/// If fan-curves are supported will also activate a fan curve for profile.
|
||||
async fn next_throttle_thermal_policy(
|
||||
&mut self,
|
||||
#[zbus(signal_context)] ctxt: SignalContext<'_>,
|
||||
#[zbus(signal_context)] ctxt: SignalEmitter<'_>,
|
||||
) -> Result<(), FdoErr> {
|
||||
let policy: ThrottlePolicy =
|
||||
platform_get_value!(self, throttle_thermal_policy, "throttle_thermal_policy")
|
||||
@@ -715,7 +716,7 @@ impl ReloadAndNotify for CtrlPlatform {
|
||||
/// Called on config file changed externally
|
||||
async fn reload_and_notify(
|
||||
&mut self,
|
||||
signal_context: &SignalContext<'static>,
|
||||
signal_context: &SignalEmitter<'static>,
|
||||
data: Self::Data,
|
||||
) -> Result<(), RogError> {
|
||||
let mut config = self.config.lock().await;
|
||||
@@ -878,7 +879,7 @@ impl CtrlTask for CtrlPlatform {
|
||||
PLATFORM_ZBUS_PATH
|
||||
}
|
||||
|
||||
async fn create_tasks(&self, signal_ctxt: SignalContext<'static>) -> Result<(), RogError> {
|
||||
async fn create_tasks(&self, signal_ctxt: SignalEmitter<'static>) -> Result<(), RogError> {
|
||||
let platform1 = self.clone();
|
||||
let platform2 = self.clone();
|
||||
let platform3 = self.clone();
|
||||
|
||||
@@ -5,7 +5,8 @@ use log::warn;
|
||||
use rog_slash::usb::{pkt_set_mode, pkt_set_options};
|
||||
use rog_slash::{DeviceState, SlashMode};
|
||||
use zbus::export::futures_util::lock::Mutex;
|
||||
use zbus::{interface, Connection, SignalContext};
|
||||
use zbus::object_server::SignalEmitter;
|
||||
use zbus::{interface, Connection};
|
||||
|
||||
use crate::ctrl_slash::CtrlSlash;
|
||||
use crate::error::RogError;
|
||||
@@ -153,7 +154,7 @@ impl crate::CtrlTask for CtrlSlashZbus {
|
||||
SLASH_ZBUS_PATH
|
||||
}
|
||||
|
||||
async fn create_tasks(&self, _: SignalContext<'static>) -> Result<(), RogError> {
|
||||
async fn create_tasks(&self, _: SignalEmitter<'static>) -> Result<(), RogError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,10 @@ use futures_lite::stream::StreamExt;
|
||||
use log::{debug, info, warn};
|
||||
use logind_zbus::manager::ManagerProxy;
|
||||
use tokio::time::sleep;
|
||||
use zbus::object_server::{Interface, SignalEmitter};
|
||||
use zbus::proxy::CacheProperties;
|
||||
use zbus::zvariant::ObjectPath;
|
||||
use zbus::{CacheProperties, Connection, SignalContext};
|
||||
use zbus::Connection;
|
||||
|
||||
use crate::error::RogError;
|
||||
|
||||
@@ -39,7 +41,7 @@ pub static DBUS_IFACE: &str = "org.asuslinux.Daemon";
|
||||
/// methods to be available:
|
||||
/// - `<name>() -> SomeValue`, functionally is a getter, but is allowed to have
|
||||
/// side effects.
|
||||
/// - `notify_<name>(SignalContext, SomeValue)`
|
||||
/// - `notify_<name>(SignalEmitter, SomeValue)`
|
||||
///
|
||||
/// In most cases if `SomeValue` is stored in a config then `<name>()` getter is
|
||||
/// expected to update it. The getter should *never* write back to the path or
|
||||
@@ -60,7 +62,7 @@ macro_rules! task_watch_item {
|
||||
concat_idents::concat_idents!(fn_name = watch_, $name {
|
||||
async fn fn_name(
|
||||
&self,
|
||||
signal_ctxt: SignalContext<'static>,
|
||||
signal_ctxt: SignalEmitter<'static>,
|
||||
) -> Result<(), RogError> {
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
|
||||
@@ -100,7 +102,7 @@ macro_rules! task_watch_item_notify {
|
||||
concat_idents::concat_idents!(fn_name = watch_, $name {
|
||||
async fn fn_name(
|
||||
&self,
|
||||
signal_ctxt: SignalContext<'static>,
|
||||
signal_ctxt: SignalEmitter<'static>,
|
||||
) -> Result<(), RogError> {
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
|
||||
@@ -143,7 +145,7 @@ pub trait ReloadAndNotify {
|
||||
|
||||
fn reload_and_notify(
|
||||
&mut self,
|
||||
signal_context: &SignalContext<'static>,
|
||||
signal_context: &SignalEmitter<'static>,
|
||||
data: Self::Data,
|
||||
) -> impl Future<Output = Result<(), RogError>> + Send;
|
||||
}
|
||||
@@ -152,7 +154,7 @@ pub trait ZbusRun {
|
||||
fn add_to_server(self, server: &mut Connection) -> impl Future<Output = ()> + Send;
|
||||
|
||||
fn add_to_server_helper(
|
||||
iface: impl zbus::Interface,
|
||||
iface: impl Interface,
|
||||
path: &str,
|
||||
server: &mut Connection,
|
||||
) -> impl Future<Output = ()> + Send {
|
||||
@@ -174,8 +176,8 @@ pub trait ZbusRun {
|
||||
pub trait CtrlTask {
|
||||
fn zbus_path() -> &'static str;
|
||||
|
||||
fn signal_context(connection: &Connection) -> Result<SignalContext<'static>, zbus::Error> {
|
||||
SignalContext::new(connection, Self::zbus_path())
|
||||
fn signal_context(connection: &Connection) -> Result<SignalEmitter<'static>, zbus::Error> {
|
||||
SignalEmitter::new(connection, Self::zbus_path())
|
||||
}
|
||||
|
||||
/// Implement to set up various tasks that may be required, using the
|
||||
@@ -183,7 +185,7 @@ pub trait CtrlTask {
|
||||
/// separate thread.
|
||||
fn create_tasks(
|
||||
&self,
|
||||
signal: SignalContext<'static>,
|
||||
signal: SignalEmitter<'static>,
|
||||
) -> impl Future<Output = Result<(), RogError>> + Send;
|
||||
|
||||
// /// Create a timed repeating task
|
||||
@@ -297,7 +299,7 @@ pub trait GetSupported {
|
||||
pub async fn start_tasks<T>(
|
||||
mut zbus: T,
|
||||
connection: &mut Connection,
|
||||
signal_ctx: SignalContext<'static>,
|
||||
signal_ctx: SignalEmitter<'static>,
|
||||
) -> Result<(), RogError>
|
||||
where
|
||||
T: ZbusRun + Reloadable + CtrlTask + Clone,
|
||||
|
||||
Reference in New Issue
Block a user