feat: add floating room climate cards and fix Symcon humidity selection
This commit is contained in:
1 parent
d7d7435e96
commit
f1ff2ff868
6 files changed
+224
-174
No files matched your search
+11
-2
@@ -13,17 +13,21 @@ $variables = [
|
||||
6 => ['VariableType' => 1, 'VariableAction' => 99],
|
||||
7 => ['VariableType' => 2, 'VariableProfile' => '~Intensity.1', 'VariableAction' => 99],
|
||||
8 => ['VariableType' => 1, 'VariableAction' => 99],
|
||||
9 => ['VariableType' => 1, 'VariableAction' => 99]
|
||||
9 => ['VariableType' => 1, 'VariableAction' => 99],
|
||||
10 => ['VariableType' => 2, 'VariableAction' => 0],
|
||||
11 => ['VariableType' => 1, 'VariableAction' => 0]
|
||||
];
|
||||
$presentations = [1 => ['SUFFIX' => ' °C'], 2 => ['SUFFIX' => "\u{00A0}°C"], 3 => ['PROFILE' => '~Temperature'], 4 => ['SUFFIX' => ' W']];
|
||||
$presentations[6] = ['MIN' => 0, 'MAX' => 255, 'STEP_SIZE' => 1, 'USAGE_TYPE' => 2, 'SUFFIX' => '%'];
|
||||
$presentations[8] = ['MIN' => 0, 'MAX' => 100, 'STEP_SIZE' => 1];
|
||||
$presentations[9] = ['MIN' => 0, 'MAX' => 255, 'STEP_SIZE' => 1];
|
||||
$presentations[10] = ['SUFFIX' => ' %'];
|
||||
$presentations[11] = ['SUFFIX' => ' ppm'];
|
||||
function IPS_GetVariable(int $id): array { global $variables; return $variables[$id] + ['VariableProfile' => '', 'VariableCustomProfile' => '', 'VariableAction' => 0, 'VariableCustomAction' => 0]; }
|
||||
function IPS_GetVariablePresentation(int $id): array { global $presentations; return $presentations[$id] ?? []; }
|
||||
function IPS_VariableProfileExists(string $profile): bool { return in_array($profile, ['~Temperature', '~Intensity.1'], true); }
|
||||
function IPS_GetVariableProfile(string $profile): array { return $profile === '~Intensity.1' ? ['MinValue' => 0, 'MaxValue' => 1, 'StepSize' => 0.01, 'Suffix' => ' %'] : ['Suffix' => ' °C']; }
|
||||
function GetValue(int $id): float|int|bool { return match ($id) { 5 => true, 6, 9 => 128, 7 => 0.4, 8 => 40, default => 21.75 }; }
|
||||
function GetValue(int $id): float|int|bool { return match ($id) { 5 => true, 6, 9 => 128, 7 => 0.4, 8 => 40, 10 => 51.6, 11 => 780, default => 21.75 }; }
|
||||
function GetValueFormatted(int $id): string { return $id === 5 ? 'An' : '21,75'; }
|
||||
$writes = [];
|
||||
function RequestAction(int $id, mixed $value): void { global $writes; $writes[] = [$id, $value]; }
|
||||
@@ -46,6 +50,11 @@ $override = $describe->invoke($module, 4, 'Temperatur', 'Haus / Temperatur', 10)
|
||||
check($override['attributes']['unit_of_measurement'] === 'W' && $override['attributes']['device_class'] === 'power', 'The effective presentation overrides a stale legacy profile and ancestor names');
|
||||
$boolean = $describe->invoke($module, 5, 'Kontakt', 'Haus / Kontakt', 10);
|
||||
check(!isset($boolean['attributes']['symcon_numeric_value']), 'Boolean values are not advertised as numeric readings');
|
||||
$humidity = $describe->invoke($module, 10, 'Raumfeuchtigkeit', 'Haus / Temperaturen / KNX / Raumfeuchtigkeit', 10);
|
||||
check($humidity['attributes']['device_class'] === 'humidity', 'Feuchtigkeit is recognized without an ancestor category overriding its meaning');
|
||||
check($humidity['attributes']['symcon_numeric_value'] === 51.6 && $humidity['attributes']['unit_of_measurement'] === '%', 'Float humidity values keep their raw value and effective percent unit');
|
||||
$co2 = $describe->invoke($module, 11, 'CO₂', 'Haus / Temperaturen / CO₂', 10);
|
||||
check($co2['attributes']['device_class'] === 'carbon_dioxide', 'CO2 with a subscript 2 is recognized for integer ppm variables');
|
||||
$dimmer = $describe->invoke($module, 6, 'Dimmer', 'Haus / Dimmer', 10);
|
||||
check($dimmer['attributes']['brightness'] === 128, 'An integer dimmer uses its real 0-255 range');
|
||||
$floatDimmer = $describe->invoke($module, 7, 'Wert', 'Haus / Wert', 10);
|
||||
|
||||
Reference in new issue
Block a user