feat: add native Symcon room climate, schedules, weather and presence

This commit is contained in:
jhartworks committed 2026-11-11 09:34:26 +01:00
1 parent 510aece983
commit 18e73194e0
37 files changed
+2861 -2132

No files matched your search

+4 -3
View File
@@ -14,6 +14,7 @@ import { formatArea, formatLength } from "../../../units.ts";
import { generateWalls, innerSize, type Wall } from "../../../geometry/walls.ts";
import { countsAsLiving, roomArea } from "../../../geometry/living-area.ts";
import { roomSpeaker } from "../../../live/announce.ts";
import { isSymcon } from "../../../entities/symcon-values.ts";
/** What the room form makes the editor do, and the parts of it that the editor still draws itself. */
export interface RoomActions {
@@ -120,7 +121,7 @@ function ceilingField(host: EditorHost, room: Room, floor: Floor, actions: RoomA
/** Announcements in the room: its speaker (automatic, chosen, or none) and a quiet time. */
function announceFields(host: EditorHost, room: Room, floor: Floor | null, actions: RoomActions): TemplateResult {
const t = host.t;
if (!host.hass) return html``;
if (!host.hass || isSymcon(host.hass)) return html``;
const auto = roomSpeaker(host.hass, floor, { ...room, announce_speaker: null });
const speakers = entityOptions(host.hass, (id) => /^(media_player|assist_satellite)\./.test(id) || (id.startsWith("notify.") && id.endsWith("_announce")));
const quiet = room.announce_quiet ?? null;
@@ -171,8 +172,8 @@ export function renderRoomForm(host: EditorHost, state: SideState, room: Room, a
${hint(t("room_floor_offset_hint"), "nf-wide")}
${entityField(host, t("room_clean"), room.clean_entity ?? null, undefined, entityOptions(host.hass, (id) => /^(script|button|input_button)\./.test(id)), (v) => actions.patch({ clean_entity: v && v !== "none" ? v : null }))}
${room.clean_entity ? nothing : hint(t("room_clean_hint"), "nf-wide")}
${entityField(host, t("floor_heating"), room.floor_heating ?? null, undefined, entityOptions(host.hass, (id) => /^(climate|switch|valve|binary_sensor|input_boolean)\./.test(id)), (v) => actions.patch({ floor_heating: v && v !== "none" ? v : null }))}
${room.floor_heating ? hint(t("floor_heating_hint"), "nf-wide") : nothing}
${isSymcon(host.hass) ? nothing : entityField(host, t("floor_heating"), room.floor_heating ?? null, undefined, entityOptions(host.hass, (id) => /^(climate|switch|valve|binary_sensor|input_boolean)\./.test(id)), (v) => actions.patch({ floor_heating: v && v !== "none" ? v : null }))}
${room.floor_heating && !isSymcon(host.hass) ? hint(t("floor_heating_hint"), "nf-wide") : nothing}
${announceFields(host, room, host.floor ?? null, actions)}
${inner ? html`<p class="nf-sub nf-wide" title=${t("room_inner_hint")}>${t("room_inner", { w: formatLength(host.hass, inner[0]), d: formatLength(host.hass, inner[1]) })}</p>` : nothing}
${livingLine(host, room, walls)}