Disruptive Documentation

Structure Battery​Status​Event

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.

%117 BatteryStatusEvent BatteryStatusEvent Codable Codable BatteryStatusEvent->Codable PublishableEvent PublishableEvent BatteryStatusEvent->PublishableEvent Equatable Equatable BatteryStatusEvent->Equatable

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.

event​Type

public var eventType: EventType  

Methods

encode(to:​)

public func encode(to encoder: Encoder) throws