no message
This commit is contained in:
@@ -30,7 +30,7 @@ class ShellyParser
|
||||
* - output (bool)
|
||||
* - temperature (float, inkl. tC)
|
||||
*/
|
||||
public static function MapParams(array $params): array
|
||||
public static function MapParams(array $params): array
|
||||
{
|
||||
$mapped = [
|
||||
'outputs' => [], // switch:x → output
|
||||
@@ -40,9 +40,7 @@ class ShellyParser
|
||||
|
||||
foreach ($params as $key => $value) {
|
||||
|
||||
// -----------------------------
|
||||
// OUTPUTS (switch:0 → output)
|
||||
// -----------------------------
|
||||
// OUTPUTS (switch:0.output)
|
||||
if (str_starts_with($key, 'switch:') && is_array($value)) {
|
||||
|
||||
$index = (int)substr($key, 7);
|
||||
@@ -51,15 +49,13 @@ class ShellyParser
|
||||
$mapped['outputs'][$index] = (bool)$value['output'];
|
||||
}
|
||||
|
||||
// Gen4 Input in switch
|
||||
// Gen4 / Pro input in switch
|
||||
if (isset($value['input'])) {
|
||||
$mapped['inputs'][$index] = (bool)$value['input'];
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------
|
||||
// INPUTS (input:0 → state)
|
||||
// -----------------------------
|
||||
// INPUTS (input:0.state)
|
||||
if (str_starts_with($key, 'input:') && is_array($value)) {
|
||||
|
||||
$index = (int)substr($key, 6);
|
||||
@@ -70,7 +66,7 @@ class ShellyParser
|
||||
}
|
||||
}
|
||||
|
||||
// Temperatur (verschachtelt)
|
||||
// Temperatur tief suchen
|
||||
self::ExtractRecursive($params, $mapped);
|
||||
|
||||
return $mapped;
|
||||
|
||||
Reference in New Issue
Block a user