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:
2026-09-13 09:34:20 +02:00
co-authored by Claude Fable 5.1
parent 66bce8e8d0
commit dba1875683
16 changed files with 380 additions and 20 deletions
+18
View File
@@ -57,6 +57,24 @@ final class NetatmoClient
return $json['body'];
}
/** @return array<string|int, mixed> timestamp => [hPa], per 30 minuten, van het basisstation */
public function getPressureHistory(string $deviceId, int $begin, int $end): array
{
$json = $this->apiGet('getmeasure', [
'device_id' => $deviceId,
'scale' => '30min',
'type' => 'Pressure',
'date_begin' => $begin,
'date_end' => $end,
'optimize' => 'false',
'real_time' => 'false',
]);
if (!is_array($json['body'] ?? null)) {
throw new UpstreamException('getmeasure (Pressure): geen body in antwoord');
}
return $json['body'];
}
/** @param array<string, string|int|float> $query */
private function apiGet(string $path, array $query): array
{