Disruptive Documentation

Structure Temperature​Event.​Temperature​Sample

public struct TemperatureSample: Codable, Equatable  

Represents a temperature value sampled within a single heartbeat.

%291 TemperatureEvent.TemperatureSample TemperatureEvent.TemperatureSample Codable Codable TemperatureEvent.TemperatureSample->Codable Equatable Equatable TemperatureEvent.TemperatureSample->Equatable

Member Of

TemperatureEvent

A temperature event that is sent for temperature sensors every heartbeat, and whenever the sensor is touched.

Conforms To

Codable
Equatable

Initializers

init(celsius:​timestamp:​)

public init(celsius: Float, timestamp: Date)  

Creates a new TemperatureSample using celsius.

init(fahrenheit:​timestamp:​)

public init(fahrenheit: Float, timestamp: Date)  

Creates a new TemperatureSample using fahrenheit.

init(from:​)

public init(from decoder: Decoder) throws  

Properties

celsius

public let celsius: Float

The temperature value in celsius.

fahrenheit

public let fahrenheit: Float

The temperature value in fahrenheit.

timestamp

public let timestamp: Date

The timestamp the temperature value was sample. This timestamp is estimated by DT Cloud, and may not be as accurate as the timestamp of the event itself.

Methods

encode(to:​)

public func encode(to encoder: Encoder) throws