summaryrefslogtreecommitdiff
path: root/src/bin/piss-level/main.rs
blob: 613407ac7a8b5b268249b7d1f6b73552422b4055 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::error::Error;

use zbus::Connection;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>>{
    let connection = Connection::session().await?;
    
    let m = connection.call_method(Some("dev.exvacuum.pissd"), "/dev/exvacuum/pissd", Some("dev.exvacuum.pissd"),"GetPissPercentage", &()).await?;
    let reply = m.body().deserialize::<f32>().unwrap();
    println!("{}", reply);
    Ok(())
}