feat: 使用左开右闭区间定义每边的 LEDs。

This commit is contained in:
2023-01-16 23:39:33 +08:00
parent af03b22d05
commit 1882b8ccdc
4 changed files with 29 additions and 24 deletions

View File

@@ -38,4 +38,18 @@ impl Manager {
.await
.map_err(|error| anyhow::anyhow!("mqtt publish failed. {}", error))
}
pub async fn publish_led_sub_pixels(&self, payload: Vec<u8>) -> anyhow::Result<()> {
self.mqtt
.client
.publish(
"display-ambient-light/desktop/colors",
rumqttc::QoS::AtLeastOnce,
false,
payload,
)
.await
.map_err(|error| anyhow::anyhow!("mqtt publish failed. {}", error))
}
}