Lue dans les fichiers PHP du paquet au commit e4e6e6e16b27 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.
BrightSkySourceclassThe Deutscher Wetterdienst's open data through Bright Sky (api.brightsky.dev): hourly weather at a point or at a DWD station - observations back to 2010 (the station records, today's reports) joined to the MOSMIX forecasts ten days ahead - temperature, dew point, humidity, precipitation, pressure, wind and gusts, cloud cover, visibility, sunshine, solar irradiation, the probability of precipitation; and a station as an entity.
5 methods · 2 constants
BrightSkySourceFactoryclassBright Sky: the Deutscher Wetterdienst's observations and MOSMIX forecasts, hourly, at a point or a station - no key.
3 options
Omnilab\BrightSky
BrightSkySource class
final class BrightSkySource extends HttpSource BrightSkySource.php:31
The Deutscher Wetterdienst's open data through Bright Sky (api.brightsky.dev): hourly weather at a point or at a DWD station - observations back to 2010 (the station records, today's reports) joined to the MOSMIX forecasts ten days ahead - temperature, dew point, humidity, precipitation, pressure, wind and gusts, cloud cover, visibility, sunshine, solar irradiation, the probability of precipitation; and a station as an entity.
No key. Observations are dense in Germany; the forecasts cover the world, sparsely outside it.
const BASE_URI = 'https://api.brightsky.dev/'const VARIABLES = ['temperature' => '°C', 'dew_point' => '°C', 'relative_humidity' => '%', 'precipitation' => 'mm', 'precipitation_probability' => '%', 'pressure_msl' => 'hPa'…The variables series() serves, with their unit (Bright Sky's "dwd" units).
BrightSkySource::__construct()
public function __construct(HttpClientInterface $http, readonly ?int $maxDistance = null, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.0)$maxDistancehow far from a Point a record may come, in metres (null: Bright Sky's default)
BrightSkySource::getName()
public function getName(): stringBrightSkySource::capabilities()
public function capabilities(): arrayBrightSkySource::entity()
public function entity(Identifier|string $id): ?EntityA DWD station (dwd:01420) or a WMO station (wmo:10637): its name, place and height, the period of its records and the kinds of records Bright Sky has of it (historical, current, synop, forecast). One call; null when unknown.
BrightSkySource::series()
public function series(SeriesQuery $query): arrayThe hourly weather at a Point (Bright Sky picks the nearest records within max_dist, a station's observations then a forecast) or at a station (dwd.station, or wigos for a WMO index), one series per variable asked, in one call: hourly as given, or the days made from the hours (SeriesQuery::DAILY with Series::MEAN, MAX, MIN or SUM) in the query's time zone (UTC by default). The period defaults to today; a date without a time is the whole day. A series is a forecast when every hour comes from MOSMIX, observed when none does, null when mixed.
BrightSkySourceFactory class
final class BrightSkySourceFactory extends SourceFactory BrightSkySourceFactory.php:20
Bright Sky: the Deutscher Wetterdienst's observations and MOSMIX forecasts, hourly, at a point or a station - no key.
options: mailto: 'support@glitchr.io' # in the User-Agent max_distance: ~ # metres: how far from a Point a record may come (null: Bright Sky's default) throttle: 0 # seconds between two calls: Bright Sky publishes no figure base_uri: 'https://api.brightsky.dev/' # or a self-hosted instance
Options
| Option | Default | |
|---|---|---|
max_distance | null | |
throttle | 0.0 | |
base_uri | BrightSkySource::BASE_URI |