v0.14.2-connectivity
This commit is contained in:
@@ -614,6 +614,12 @@ impl GreeCloudProvider {
|
||||
.ok_or_else(|| anyhow!("GREE Cloud MQTT is disconnected"))
|
||||
}
|
||||
|
||||
pub async fn probe_mqtt(&self, settings: &GreeCloudSettings, devices: &[Device]) -> Result<u64> {
|
||||
self.ensure_connected(settings, devices).await?;
|
||||
let session = self.current_session().await?;
|
||||
session.mqtt.ping_round_trip().await
|
||||
}
|
||||
|
||||
pub async fn ensure_connected(&self, settings: &GreeCloudSettings, devices: &[Device]) -> Result<()> {
|
||||
if !settings.enabled {
|
||||
bail!("GREE Cloud is disabled");
|
||||
|
||||
Reference in New Issue
Block a user