Skip to content

Instantly share code, notes, and snippets.

@beraylik
Created August 5, 2019 06:07
Show Gist options
  • Save beraylik/daeb2e8a16e4271765d01a5ee800c5f3 to your computer and use it in GitHub Desktop.
Save beraylik/daeb2e8a16e4271765d01a5ee800c5f3 to your computer and use it in GitHub Desktop.
someCode
protocol Device {}
protocol DeviceState {}
enum Types {
case timer
case action
case event
}
protocol ScriptTrigger {
var type: Types { get }
var isTriggered: Bool { get }
}
protocol TimerTrigger {
var targetTime: Date { get }
var repeats: Int? { get }
}
protocol ScriptAction {
var device: Device { get }
var state: DeviceState { get }
var targetValue: String { get set }
}
protocol Script {
var isEnabled: Bool { get set }
var isProcessing: Bool { get }
var trigger: ScriptTrigger { get }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment