feat: Adds MQTTConnectionManagerLive module.

This commit is contained in:
2024-11-11 22:00:14 -05:00
parent ef552fb8bc
commit bf1126b06a
4 changed files with 137 additions and 108 deletions

View File

@@ -2,7 +2,7 @@ import Dependencies
import Foundation
import Logging
import Models
import MQTTConnectionService
import MQTTConnectionManagerLive
import MQTTNIO
import NIO
import PsychrometricClientLive
@@ -33,11 +33,12 @@ struct Application {
logger: logger
)
let mqttConnection = MQTTConnectionService(client: mqtt)
try await withDependencies {
$0.psychrometricClient = PsychrometricClient.liveValue
$0.psychrometricClient = .liveValue
$0.sensorsClient = .live(client: mqtt)
$0.mqttConnectionManager = .live(client: mqtt, logger: logger)
} operation: {
let mqttConnection = MQTTConnectionService(cleanSession: false, logger: logger)
let sensors = SensorsService(sensors: .live)
var serviceGroupConfiguration = ServiceGroupConfiguration(