Pebble App Framework: Phone API
    Preparing search index...

    Function locationInstance

    • One place's reading as a weather/location instance.

      It sends every single value, and each series only when the request asks for it, or every series when the request names none, as the built-in does. The place's latitude and longitude go out only to a request that names them, and only as a pair of real coordinates, since only a face that wants the wearer's place should get it. Temperatures, wind, and pressure go out in the units given, each with its unit and a short text in the built-in's style. utc_offset is in minutes east of UTC, as the built-in sends it. The series are the reading's own, so their stamps keep the reading's clock, and a reader places each point by its stamp.

      The Pebble app takes an instance only when it holds today's and tomorrow's high, low, condition code, sunrise, and sunset. A reading without two days from the place's today, which covers one whose series Open-Meteo could not give, answers no instance. The caller leaves the place out, so the Pebble app takes it from its own backend, or serves a failover reading for it instead. Through a polar night or a midnight sun the sunrise and sunset are gaps, so the instance goes out and the Pebble app fills the watch's Weather app from its backend for that place, as it would for the built-in.

      Parameters

      • reading: WeatherReading

        The place's reading.

      • place: Pick<WeatherPlace, "name" | "key"> & Partial<Pick<WeatherPlace, "lat" | "lon">>

        The place, whose key the instance goes out under and whose name and coordinates it carries. Coordinates left out are not served.

      • units: WeatherUnits

        The units to serve in.

      • asked: readonly string[] | undefined

        The property names the request asks for, which picks the series, or undefined for every series.

      • nowMs: number

        Now, in epoch milliseconds, for which day is the place's today.

      • offsetAt: PhoneOffset = phoneOffsetMinutes

        Reads the phone's offset, for the updated label. A spec stands the phone in another zone with it.

      Returns SourceInstance | null

      The instance, or null when the reading does not hold today and tomorrow.