Report AirFilter humidity
All checks were successful
Build and deploy automation_rs / Build automation_rs (push) Successful in 3m57s
Build and deploy automation_rs / Build Docker image (push) Successful in 44s
Build and deploy automation_rs / Deploy Docker container (push) Successful in 29s

This commit is contained in:
2024-04-23 02:28:19 +02:00
parent 8b191f6013
commit 8b0c1ae352
7 changed files with 76 additions and 30 deletions

View File

@@ -11,6 +11,8 @@ pub enum Trait {
Scene,
#[serde(rename = "action.devices.traits.FanSpeed")]
FanSpeed,
#[serde(rename = "action.devices.traits.HumiditySetting")]
HumiditySetting,
}
#[async_trait]
@@ -72,3 +74,14 @@ pub trait FanSpeed {
async fn current_speed(&self) -> String;
async fn set_speed(&self, speed: &str) -> Result<(), ErrorCode>;
}
#[async_trait]
#[impl_cast::device_trait]
pub trait HumiditySetting {
// TODO: This implementation is not complete, I have only implemented what I need right now
fn query_only_humidity_setting(&self) -> Option<bool> {
None
}
async fn humidity_ambient_percent(&self) -> isize;
}