Weather

class Weather : PlatformTrait, WeatherTrait.Attributes, Updatable


This trait provides an interface for the weather conditions for a given Structure. The weather information provided is based on the structure's address. If the structure's address has not been set, then creation of an automation using this trait will fail validation.

Summary

Nested types

Descriptor enum for this trait's attributes.

Public functions

open suspend Weather
update(optimisticReturn: (Weather) -> Unit, init: WeatherTrait.MutableAttributes.() -> Unit)

Updater function to modify any writable attributes.

Public properties

open TraitFactory<Weather>

Inherited functions

From com.google.home.google.PlatformTrait
ObjectCommand
<REQUEST : Any?> createObjectCommand(
    commandId: String,
    request: PlatformTraitPayload<REQUEST>
)
suspend Unit
sendCommand(commandId: String)
suspend Unit
<REQUEST : Any?> sendCommand(
    commandId: String,
    request: PlatformTraitPayload<REQUEST>
)
suspend RESPONSE
<RESPONSE : Any?> sendCommand(
    commandId: String,
    responseParser: Parser<RESPONSE>
)
suspend RESPONSE
<REQUEST : Any?, RESPONSE : Any?> sendCommand(
    commandId: String,
    request: PlatformTraitPayload<REQUEST>,
    responseParser: Parser<RESPONSE>
)
suspend Unit
<T : Any?> write(parser: Parser<T>, attributes: T, useTimedInteraction: Boolean)

Inherited properties

From com.google.home.google.PlatformTrait
From com.google.home.google.WeatherTrait.Attributes
open WeatherTrait.CurrentConditions?

The current weather conditions.

open List<WeatherTrait.DailyForecastConditions>

10 days of daily forecasted weather conditions.

open List<WeatherTrait.HourlyForecastConditions>

12 hours of hourly forecasted weather conditions.

open Long?

Epoch time in seconds of last update for any of the weather data.

open Boolean?

True if the user's home does not have address information in the system.

open WeatherTrait.WeatherProvider?

The source of the weather data.

Public functions

update

open suspend fun update(optimisticReturn: (Weather) -> Unit, init: WeatherTrait.MutableAttributes.() -> Unit): Weather

Updater function to modify any writable attributes.

Public properties

factory

open val factoryTraitFactory<Weather>