feat(api): humidity, CO2, current pressure and 24h pressure history
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ final class FakeSource implements WeatherSource
|
||||
public array $responses = [];
|
||||
|
||||
/** @var array<string, int> */
|
||||
public array $calls = ['stations' => 0, 'measure' => 0, 'forecast' => 0];
|
||||
public array $calls = ['stations' => 0, 'measure' => 0, 'pressure' => 0, 'forecast' => 0];
|
||||
|
||||
/** @var array<string, array> */
|
||||
public array $lastArgs = [];
|
||||
@@ -24,6 +24,7 @@ final class FakeSource implements WeatherSource
|
||||
$s->responses = [
|
||||
'stations' => json_decode((string) file_get_contents(__DIR__ . '/fixtures/getstationsdata.json'), true)['body'],
|
||||
'measure' => json_decode((string) file_get_contents(__DIR__ . '/fixtures/getmeasure.json'), true)['body'],
|
||||
'pressure' => json_decode((string) file_get_contents(__DIR__ . '/fixtures/getmeasure-pressure.json'), true)['body'],
|
||||
'forecast' => json_decode((string) file_get_contents(__DIR__ . '/fixtures/forecast.json'), true)['daily'],
|
||||
];
|
||||
return $s;
|
||||
@@ -39,6 +40,11 @@ final class FakeSource implements WeatherSource
|
||||
return $this->answer('measure', func_get_args());
|
||||
}
|
||||
|
||||
public function pressureHistory(string $deviceId, int $begin, int $end): array
|
||||
{
|
||||
return $this->answer('pressure', func_get_args());
|
||||
}
|
||||
|
||||
public function forecast(float $lat, float $lon, string $timezone): array
|
||||
{
|
||||
return $this->answer('forecast', func_get_args());
|
||||
|
||||
Reference in New Issue
Block a user