generated from Cyberbeni/MultiArchSwiftDockerfileExample
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Cyberbeni/device_tracker
Also add device tracker for presence detection
- Loading branch information
Showing
3 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Foundation | ||
|
||
extension Mqtt { | ||
/// https://www.home-assistant.io/integrations/device_tracker/ | ||
/// https://www.home-assistant.io/integrations/device_tracker.mqtt/ | ||
struct DeviceTracker: Encodable { | ||
let availabilityTopic: String? | ||
let device: Device | ||
/// Can be set to `.explicitNone` if only the device name is relevant. | ||
let name: String?? | ||
let payloadHome: String? | ||
let payloadNotHome: String? | ||
let sourceType: SourceType | ||
let stateTopic: String | ||
let uniqueId: String | ||
|
||
/// https://www.home-assistant.io/integrations/device_tracker.mqtt/#source_type | ||
enum SourceType: String, Encodable { | ||
case gps | ||
case router | ||
case bluetooth | ||
case bluetoothLe = "bluetooth_le" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters