feat: Adds MQTTConnectionService

This commit is contained in:
2024-11-09 09:03:31 -05:00
parent 79bb162434
commit 90c5b7c77f
4 changed files with 92 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
import Foundation
import Logging
@preconcurrency import Models
import Models
@preconcurrency import MQTTNIO
import NIO
import Psychrometrics
@@ -102,13 +102,12 @@ public actor SensorsService: Service {
// MARK: - Errors
struct DecodingError: Error {}
struct MQTTClientNotConnected: Error {}
struct NotFoundError: Error {}
struct SensorExists: Error {}
// MARK: - Helpers
struct MQTTClientNotConnected: Error {}
private extension TemperatureAndHumiditySensor.Topics {
func contains(_ topic: String) -> Bool {
temperature == topic || humidity == topic