feat: improve Symcon designer controls and KNX temperature selection
This commit is contained in:
1 parent
804f2d0494
commit
b934f78b9a
24 files changed
+908
-562
No files matched your search
@@ -2,7 +2,24 @@ import assert from "node:assert/strict";
|
||||
import { test } from "node:test";
|
||||
import { entity, floorWith, box, hassOf } from "./fixtures.ts";
|
||||
import { registerPlugin, resetPlugins } from "../plugins/registry.ts";
|
||||
import { areaEntities, entityAreaId, entityKind, groupByDevice, isHubDevice, isRelevant, isRoomClimateSensor, otherAreaEntities, powerSensorsOf, primaryEntities, roomClimateSensors, roomClimateValue, unassignedEntities } from "./registry.ts";
|
||||
import { areaEntities, entityAreaId, entityKind, groupByDevice, isClimateValueSensor, isHubDevice, isRelevant, isRoomClimateSensor, otherAreaEntities, powerSensorsOf, primaryEntities, roomClimateSensors, roomClimateValue, unassignedEntities } from "./registry.ts";
|
||||
|
||||
test("a KNX numeric temperature remains selectable and readable even with an inferred actuator domain", () => {
|
||||
const hass = hassOf([
|
||||
entity("climate.12345", "heat", { symcon_id: 12345, symcon_variable_type: 2, symcon_numeric_value: 21.75, unit_of_measurement: "°C" }),
|
||||
entity("sensor.23456", "22.5", { symcon_id: 23456, symcon_variable_type: 2, unit_of_measurement: " °C " }),
|
||||
entity("sensor.power", "12", { device_class: "power", unit_of_measurement: "W" }),
|
||||
entity("light.lamp", "on", { unit_of_measurement: "°C" }),
|
||||
entity("sensor.fahrenheit", "68", { unit_of_measurement: "℉" }),
|
||||
]);
|
||||
assert.equal(isClimateValueSensor(hass, "climate.12345", "temperature"), true);
|
||||
assert.equal(isClimateValueSensor(hass, "sensor.23456", "temperature"), true);
|
||||
assert.equal(isClimateValueSensor(hass, "sensor.power", "temperature"), false);
|
||||
assert.equal(isClimateValueSensor(hass, "light.lamp", "temperature"), false);
|
||||
const room = { ...box("room", 0, 0, 4, 4), climate: { temperature: "climate.12345" } };
|
||||
assert.equal(roomClimateValue(hass, null, room, "temperature"), 21.75);
|
||||
assert.equal(roomClimateValue(hass, null, { ...room, climate: { temperature: "sensor.fahrenheit" } }, "temperature"), 20);
|
||||
});
|
||||
|
||||
const lounge = hassOf(
|
||||
[
|
||||
|
||||
Reference in new issue
Block a user