Skip to content

WeatherService

A connected device for the Open Weather web service.

Add it to a protocol with addConnectedDevice to enable the ContextSamplingPackage.WEATHER measure. Managed at runtime by WeatherServiceManager.

Inheritance
Annotations

Constructors

WeatherService.fromJson

WeatherService.fromJson(
  1. Map<String, dynamic> json
)

WeatherService

WeatherService({
  1. String? roleName,
  2. required String apiKey,
})

Constants

DEFAULT_ROLE_NAME

String const DEFAULT_ROLE_NAME

The default role name for a weather service.

DEVICE_TYPE

String const DEVICE_TYPE

The type of a weather service.

Properties

apiKey

String apiKey
getter/setter pair

API key for the Open Weather API.

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.