struct SolarTimeextension SolarTime : AutomationValue, Copyable, Decodable, Encodable, Equatable, Equatable, Escapable, Hashable, Hashable, Sendable, Sendable, StructDataRepresentableThe time of a daily solar event such as sunrise, noon, and sunset.
-
Indicates the type of solar event, either sunrise or sunset.
Declaration
Swift
let type: SolarTime.SolarTimeType -
Represents seconds before (negative value) or after the solar time.
Declaration
Swift
let offset: Duration -
Initializes
SolarTimewith the type and offset.Declaration
Swift
init(type: SolarTime.SolarTimeType, offset: Duration = .seconds(0))Parameters
typeThe type of solar event, either sunrise or sunset.
offsetThe time offset from the solar event.
-
Initializes
SolarTimewith the trait decoder.Declaration
Swift
init(decoder: TraitDecoder) throwsParameters
decoderThe trait decoder to decode the solar time.
-
Undocumented
Declaration
Swift
enum SolarTimeTypeextension SolarTime.SolarTimeType : AutomationValue, Decodable, Encodable, Enum, Enum8, Equatable, Hashable, RawRepresentable, Sendable -
Encodes
SolarTimeto the trait encoder.Declaration
Swift
func encode(with encoder: TraitEncoder) throws -
Returns the field corresponding to the given field ID.
Declaration
Swift
static func structField(id: UInt32) -> (any Field)? -
Creates a new instance by decoding from the given decoder.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
Declaration
Swift
init(from decoder: any Decoder) throws