Cleaned up / removed old MQTT client.
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
|
||||
/// Represents a relay that can be controlled by the MQTT Broker.
|
||||
public struct Relay {
|
||||
|
||||
/// The topic for the relay.
|
||||
public var topic: String
|
||||
|
||||
/// Create a new relay at the given topic.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - topic: The topic for commanding the relay.
|
||||
public init(topic: String) {
|
||||
self.topic = topic
|
||||
}
|
||||
}
|
||||
|
||||
public enum Relay2 {
|
||||
|
||||
/// The topic to read the current state of the relay from.
|
||||
case read(topic: String)
|
||||
|
||||
/// The topic to command the relay state.
|
||||
case command(topic: String)
|
||||
}
|
||||
|
||||
extension Relay {
|
||||
|
||||
/// Represents the different commands that can be sent to a relay.
|
||||
public enum State: String {
|
||||
|
||||
/// Toggle the relay state on or off based on it's current state.
|
||||
case toggle
|
||||
|
||||
/// Turn the relay off.
|
||||
case off
|
||||
|
||||
/// Turn the relay on.
|
||||
case on
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
/// Represents a sensor that provides a reading.
|
||||
public struct Sensor<Reading>: Equatable {
|
||||
|
||||
/// The topic to retrieve the reading from.
|
||||
public var topic: String
|
||||
|
||||
/// Create a new sensor for the given topic.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - topic: The topic to retrieve the readings from.
|
||||
public init(topic: String) {
|
||||
self.topic = topic
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user