fixed led error

This commit is contained in:
jhartworks committed 2026-10-22 13:04:14 +02:00
1 parent 403a19ac85
commit f7757aa0cc
1 file changed
+3 -1
+3 -1
View File
@@ -491,7 +491,9 @@ class DevoloMagic extends IPSModule
if ($response['status'] === 401 || $response['status'] === 403) { if ($response['status'] === 401 || $response['status'] === 403) {
throw new RuntimeException('Gerätepasswort wurde abgelehnt.', self::STATUS_AUTHENTICATION); throw new RuntimeException('Gerätepasswort wurde abgelehnt.', self::STATUS_AUTHENTICATION);
} }
if ($response['status'] < 200 || $response['status'] >= 300 || $response['body'] === '') { // Proto3 serializes a message containing only default values as zero bytes.
// For example LedSettingsGet with LED_ON (= 0) legitimately has an empty body.
if ($response['status'] < 200 || $response['status'] >= 300) {
throw new RuntimeException('Magic-API antwortet für ' . $endpoint . ' mit HTTP ' . $response['status'] . '.', self::STATUS_COMMUNICATION); throw new RuntimeException('Magic-API antwortet für ' . $endpoint . ' mit HTTP ' . $response['status'] . '.', self::STATUS_COMMUNICATION);
} }
return $response['body']; return $response['body'];