feat: Begins more work on async integration
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
|
||||
/// A container for all the different topics that are needed by the application.
|
||||
/// A container for all the different MQTT topics that are needed by the application.
|
||||
public struct Topics: Codable, Equatable {
|
||||
|
||||
|
||||
/// The command topics the application can publish to.
|
||||
public var commands: Commands
|
||||
|
||||
|
||||
/// The sensor topics the application can read from / write to.
|
||||
public var sensors: Sensors
|
||||
|
||||
|
||||
/// The set point topics the application can read set point values from.
|
||||
public var setPoints: SetPoints
|
||||
|
||||
|
||||
/// The state topics the application can read state values from.
|
||||
public var states: States
|
||||
|
||||
|
||||
/// Create the topics required by the application.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -32,17 +32,17 @@ public struct Topics: Codable, Equatable {
|
||||
self.setPoints = setPoints
|
||||
self.states = states
|
||||
}
|
||||
|
||||
|
||||
/// Represents the sensor topics.
|
||||
public struct Sensors: Codable, Equatable {
|
||||
|
||||
public var mixedAirSensor: TemperatureAndHumiditySensor<State.Sensors.Mixed>
|
||||
|
||||
public var mixedAirSensor: TemperatureAndHumiditySensor<State.Sensors.MixedAir>
|
||||
public var postCoilSensor: TemperatureAndHumiditySensor<State.Sensors.PostCoil>
|
||||
public var returnAirSensor: TemperatureAndHumiditySensor<State.Sensors.Return>
|
||||
public var supplyAirSensor: TemperatureAndHumiditySensor<State.Sensors.Supply>
|
||||
|
||||
|
||||
public init(
|
||||
mixedAirSensor: TemperatureAndHumiditySensor<State.Sensors.Mixed> = .default(location: "mixed=air"),
|
||||
mixedAirSensor: TemperatureAndHumiditySensor<State.Sensors.MixedAir> = .default(location: "mixed-air"),
|
||||
postCoilSensor: TemperatureAndHumiditySensor<State.Sensors.PostCoil> = .default(location: "post-coil"),
|
||||
returnAirSensor: TemperatureAndHumiditySensor<State.Sensors.Return> = .default(location: "return"),
|
||||
supplyAirSensor: TemperatureAndHumiditySensor<State.Sensors.Supply> = .default(location: "supply")
|
||||
@@ -52,13 +52,13 @@ public struct Topics: Codable, Equatable {
|
||||
self.returnAirSensor = returnAirSensor
|
||||
self.supplyAirSensor = supplyAirSensor
|
||||
}
|
||||
|
||||
|
||||
public struct TemperatureAndHumiditySensor<Location>: Codable, Equatable {
|
||||
public var temperature: String
|
||||
public var humidity: String
|
||||
public var dewPoint: String
|
||||
public var enthalpy: String
|
||||
|
||||
|
||||
/// Create a new sensor topic container.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -78,16 +78,16 @@ public struct Topics: Codable, Equatable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// A container for set point related topics used by the application.
|
||||
public struct SetPoints: Codable, Equatable {
|
||||
|
||||
|
||||
/// The topic for the humidify set point.
|
||||
public var humidify: Humidify
|
||||
|
||||
|
||||
/// The topics for dehumidification set points.
|
||||
public var dehumidify: Dehumidify
|
||||
|
||||
|
||||
/// Create a new set point topic container.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -100,16 +100,16 @@ public struct Topics: Codable, Equatable {
|
||||
self.humidify = humidify
|
||||
self.dehumidify = dehumidify
|
||||
}
|
||||
|
||||
|
||||
/// A container for the humidification set point topics used by the application.
|
||||
public struct Humidify: Codable, Equatable {
|
||||
|
||||
|
||||
/// The topic for dew point control mode set point.
|
||||
public var dewPoint: String
|
||||
|
||||
|
||||
/// The topic for relative humidity control mode set point.
|
||||
public var relativeHumidity: String
|
||||
|
||||
|
||||
/// Create a new container for the humidification set point topics.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -123,22 +123,22 @@ public struct Topics: Codable, Equatable {
|
||||
self.relativeHumidity = relativeHumidity
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// A container for dehumidifcation set point topics.
|
||||
public struct Dehumidify: Codable, Equatable {
|
||||
|
||||
|
||||
/// A low setting for dew point control modes.
|
||||
public var lowDewPoint: String
|
||||
|
||||
|
||||
/// A high setting for dew point control modes.
|
||||
public var highDewPoint: String
|
||||
|
||||
|
||||
/// A low setting for relative humidity control modes.
|
||||
public var lowRelativeHumidity: String
|
||||
|
||||
|
||||
/// A high setting for relative humidity control modes.
|
||||
public var highRelativeHumidity: String
|
||||
|
||||
|
||||
/// Create a new container for dehumidification set point topics.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -159,16 +159,16 @@ public struct Topics: Codable, Equatable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// A container for control state topics used by the application.
|
||||
public struct States: Codable, Equatable {
|
||||
|
||||
|
||||
/// The topic for the control mode.
|
||||
public var mode: String
|
||||
|
||||
|
||||
/// The relay state topics.
|
||||
public var relays: Relays
|
||||
|
||||
|
||||
/// Create a new container for control state topics.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -180,19 +180,19 @@ public struct Topics: Codable, Equatable {
|
||||
self.mode = mode
|
||||
self.relays = relays
|
||||
}
|
||||
|
||||
|
||||
/// A container for reading the current state of a relay.
|
||||
public struct Relays: Codable, Equatable {
|
||||
|
||||
|
||||
/// The dehumidification stage-1 relay topic.
|
||||
public var dehumdification1: String
|
||||
|
||||
|
||||
/// The dehumidification stage-2 relay topic.
|
||||
public var dehumidification2: String
|
||||
|
||||
|
||||
/// The humidification relay topic.
|
||||
public var humdification: String
|
||||
|
||||
|
||||
/// Create a new container for relay state topics.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -210,13 +210,13 @@ public struct Topics: Codable, Equatable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// A container for commands topics that the application can publish to.
|
||||
public struct Commands: Codable, Equatable {
|
||||
|
||||
|
||||
/// The relay command topics.
|
||||
public var relays: Relays
|
||||
|
||||
|
||||
/// Create a new command topics container.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -224,19 +224,19 @@ public struct Topics: Codable, Equatable {
|
||||
public init(relays: Relays = .init()) {
|
||||
self.relays = relays
|
||||
}
|
||||
|
||||
|
||||
/// A container for relay command topics used by the application.
|
||||
public struct Relays: Codable, Equatable {
|
||||
|
||||
|
||||
/// The dehumidification stage-1 relay topic.
|
||||
public var dehumidification1: String
|
||||
|
||||
|
||||
/// The dehumidification stage-2 relay topic.
|
||||
public var dehumidification2: String
|
||||
|
||||
|
||||
/// The humidification relay topic.
|
||||
public var humidification: String
|
||||
|
||||
|
||||
/// Create a new container for commanding relays.
|
||||
///
|
||||
/// - Parameters:
|
||||
|
||||
Reference in New Issue
Block a user