Structure
BatteryStatusEvent
public struct BatteryStatusEvent: Codable, Equatable
A battery status event is sent quite rarely since the battery life of the sensors lasts up to 15 years. It indicates how much battery life is left in the sensor.
See the Developer Website for more details.
Relationships
Conforms To
PublishableEvent
Used by event types (such as
TouchEvent
) to indicate that they can be published to the device emulator.Codable
Equatable
Initializers
init(percentage:timestamp:)
public init(percentage: Int, timestamp: Date)
Creates a new BatteryStatusEvent
.
init(from:)
public init(from decoder: Decoder) throws
Properties
percentage
public let percentage: Int
The amount of battery life left in the sensor as a percentage.
timestamp
public let timestamp: Date
The timestamp of when the battery status event was received by a Cloud Connector.
eventType
public var eventType: EventType
Methods
encode(to:)
public func encode(to encoder: Encoder) throws