This commit is contained in:
Mateusz Gruszczyński
2026-08-24 00:28:19 +02:00
parent 10bc9aa099
commit eb02f66056
7 changed files with 23 additions and 15 deletions
+4 -4
View File
@@ -296,18 +296,18 @@ impl GreeClient {
}
pub async fn poll(&self, device: &mut Device) -> Result<()> {
let key = device.key.as_deref().ok_or_else(|| anyhow!("device is not bound"))?;
let key = device.key.clone().ok_or_else(|| anyhow!("device is not bound"))?;
let full_cols = [
"Pow","Mod","SetTem","WdSpd","Air","Blo","Health","SwhSlp","Lig",
"SwingLfRig","SwUpDn","Quiet","Tur","StHt","TemUn","HeatCoolType",
"TemRec","SvSt","TemSen","CoolSvTem","HeatSvTem","OutEnvTem"
];
let core_cols = ["Pow","Mod","SetTem","TemRec","TemUn","TemSen","WdSpd","Lig","SwingLfRig","SwUpDn","Quiet","Tur"];
let (response, used_core_fallback) = match self.status_request(device, key, &full_cols).await {
let (response, used_core_fallback) = match self.status_request(device, &key, &full_cols).await {
Ok(value) => (value, false),
Err(first) => {
tracing::debug!(device=%device.id, error=?first, "Full GREE status request failed; retrying core properties");
(self.status_request(device, key, &core_cols).await?, true)
(self.status_request(device, &key, &core_cols).await?, true)
}
};
self.apply_status(device, &response)?;
@@ -315,7 +315,7 @@ impl GreeClient {
// Probe it separately after the core fallback so compatible units can contribute
// their outdoor sensor to history without making the main poll fail.
if used_core_fallback {
match self.status_request(device, key, &["OutEnvTem"]).await {
match self.status_request(device, &key, &["OutEnvTem"]).await {
Ok(optional) => { let _ = self.apply_status(device, &optional); }
Err(err) => tracing::trace!(device=%device.id, error=?err, "GREE outdoor temperature is not available"),
}