@camstack/types 1.2.557 → 1.2.558
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/addon.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/automation/action-target.d.ts +8 -0
- package/dist/{composed-stable-id-CDNLq7Y8.js → composed-stable-id-BmJ_5GiE.js} +5 -0
- package/dist/{composed-stable-id-CPp3votu.mjs → composed-stable-id-iddnCQ51.mjs} +5 -0
- package/dist/composition/composition.d.ts +8 -0
- package/dist/composition/helpers/index.d.ts +1 -1
- package/dist/composition/helpers/save.d.ts +2 -0
- package/dist/composition/helpers/source-pick.d.ts +11 -5
- package/dist/composition/validate-composition.d.ts +2 -0
- package/dist/device/device-kind.d.ts +36 -0
- package/dist/device/device-type.d.ts +5 -0
- package/dist/device/hero/hero-look.d.ts +6 -0
- package/dist/device/hero/hero-scene.d.ts +1 -0
- package/dist/device/index.d.ts +1 -1
- package/dist/{implemented-methods-5YMDeE3f.mjs → implemented-methods-CSTk6zYK.mjs} +147 -2
- package/dist/{implemented-methods-Cj65uy2F.js → implemented-methods-CfaRR_ki.js} +212 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +273 -253
- package/dist/index.mjs +259 -247
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/{sleep-DyIxjZZt.mjs → sleep-BvVGLl30.mjs} +8 -1
- package/dist/{sleep-1RkA30Y1.js → sleep-CyWfD1LJ.js} +8 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.558] - 2026-11-13
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- New switch role switch-light: a relay driving an on/off-only lamp, drawn and exported as a light with power only
|
|
15
|
+
- Switch sub-role accessors (isOutlet, isSwitchFan, isSwitchHeater) and a light group accepts a switch-light relay as an on/off member.
|
|
16
|
+
- A device type retired since a record was written (thermostat) is read as its live type in stored grants, automation targets and composition targets instead of failing the parse
|
|
17
|
+
- The device-type wire schemas stay strict; stores rewrite the retired thermostat type where they read rows back, and the hero layout of a retired type is the climate one
|
|
18
|
+
|
|
10
19
|
## [1.2.557] - 2026-11-12
|
|
11
20
|
|
|
12
21
|
### Changed
|
package/dist/addon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-CyWfD1LJ.js");
|
|
3
3
|
const require_event_category = require("./event-category-Ps2LC8dN.js");
|
|
4
|
-
const require_composed_stable_id = require("./composed-stable-id-
|
|
4
|
+
const require_composed_stable_id = require("./composed-stable-id-BmJ_5GiE.js");
|
|
5
5
|
//#region src/generated/cap-input-defaults.ts
|
|
6
6
|
/**
|
|
7
7
|
* AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
|
package/dist/addon.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as DEVICE_CHILDREN_BATCH_MAX, $i as createEvent, $r as secretArrayPrefixes, A as CAP_ADVANCE_FIELDS, Ai as NoCallerError, An as PEER_BYTES_MAX_OUTSTANDING, Bi as UnindexedFilterError, Bn as EntryDescriptorSchema, Cn as clearKnownSecrets, Cr as normalizeAddonInitResult, Di as FilterRequiredError, Dn as scrubKnownSecrets, Ea as findMigrationsBlocked, Ei as DeclarationRefusedError, En as registerKnownSecret, Et as createDebugEmitter, F as withoutCallerStamp, Fi as RecordTooLargeError, Fn as DATAPLANE_SECRET_HEADER, Fr as resolveDeviceSettings, G as readNodePin, Gn as RecordRetentionSchema, Gr as secretViewsOf, H as commandOrigin, Hi as asRecordsError, Hn as RecordIndexSchema, I as customAction, Ii as RecordUniqueViolationError, Ir as resolvedValues, J as PipelineRunResultBridge, Jn as declarationsOf, Jr as mapSecretLeaves, Kn as StoredRecordKindDeclarationSchema, Kr as REMOVE_LEAF, L as defineCustomActions, Li as RecordsError, Ln as DisposerChain, Mi as RECORDS_ERROR_CODES, Mn as PEER_BYTES_TICKET_TTL_MS, N as CAP_STATE_LEAVES, Ni as RecordNotFoundError, Nr as SCOPED_SETTINGS_SCOPES, O as HF_REPO, Oi as ForeignSecretMarkerError, On as shortSecretRefHash, P as CALLER_STAMPED_CAPABILITIES, Pi as RecordSecretUnavailableError, Pn as CALLER_USERNAME_HEADER, Pr as nodeIdOfScopedKey, Q as deviceOpsCapability, Qn as isZodSecret, Qr as recordSecretRef, R as describeCustomActions, Ri as RevConflictError, Rn as defineEntryKind, Sn as MIN_SCRUBBED_LENGTH, T as isCommand, Ta as AddonMigrationsBlockedError, Ti as BatchTooLargeError, Tn as knownSecretCount, U as nodePin, Ui as recordsErrorFromMessage, Un as RecordKindDeclarationSchema, Vi as UnknownRecordKindError, Vn as RecordFieldPathSchema, W as readCommandOrigin, Wn as RecordKindNameSchema, X as MIGRATION_API_VERSION, Xr as recordArrayItemPath, Y as PipelineStepInputSchema, Yn as defineRecordKinds, Yr as parseSecretPath, Zn as collectZodSecretPaths, Zr as recordSecretCollection, _a as toSecretFieldView, _i as formatSecretScope, _n as createRecordsAccess, ai as RECORD_DELETE_BATCH, bi as normalizeSecretOwner, bn as REVALIDATE_AFTER_MS, br as BaseAddon, c as asString, ci as RECORD_MAX_INDEXES, d as parseJsonUnknown, da as classifySecretWrite, di as RECORD_SECRET_COLLECTION_PREFIX, ea as emitReadiness, ei as RECORD_BATCH_MAX, et as adminUiCapability, f as hfModelUrl, fa as isSecretClear, fi as RECORD_SETTINGS_MAX_ROWS, g as createDeviceProxy, ga as makeSecretMarker, gi as buildSecretRef, gn as makeInMemoryRecords, h as isDeviceScopedCap, ha as isSecretMarkerLike, hi as arrayItemFieldPath, hn as ruleFireOfClaim, hr as ErrorI18nPayloadSchema, ht as ReadinessTimeoutError, ii as RECORD_DEFAULT_MAX_DATA_BYTES, j as CAP_METHOD_TIMEOUTS_MS, ji as PlaintextSecretError, jn as PEER_BYTES_STALL_MS, ki as InvalidRecordError, kn as PEER_BYTES_CHUNK_BYTES, li as RECORD_MAX_INDEX_FIELDS, m as DEVICE_SCOPED_CAPS, ma as isSecretMarker, mi as SECRET_REF_SCHEME, mn as RuleFireOriginSchema, mt as ReadinessRegistry, ni as RECORD_CLASSES, nt as addonPagesSourceCapability, o as asJsonObject, oi as RECORD_ID_MAX_LENGTH, or as expandCapMethods, p as BOOT_RECOVERY_BACKOFF_MS, pa as isSecretFieldView, pi as RECORD_SWEEP_INTERVAL_MS, pn as CommandOriginClaimSchema, pt as MODEL_FORMATS, q as viewerUiCapability, qn as assertValidDeclaration, qr as collectSecretLeaves, r as maskUrlCredentials, ri as RECORD_DATABASES, si as RECORD_MAX_DATA_BYTES, t as sleep, ti as RECORD_BATCH_MAX_BYTES, ua as SECRET_CLEAR, ui as RECORD_QUERY_MAX, v as addonSliceHandleApi, vi as globalSecretScope, vn as assertTransactScope, vr as readErrorI18n, vt as scopeKey, wn as forgetKnownSecret, xi as parseSecretRef, xn as createSecretsAccess, y as createEventBusSliceSource, yi as isSecretRef, yn as resolveSecretViewsIn, zi as TransactRefusedError, zn as entryBody } from "./sleep-
|
|
1
|
+
import { $ as DEVICE_CHILDREN_BATCH_MAX, $i as createEvent, $r as secretArrayPrefixes, A as CAP_ADVANCE_FIELDS, Ai as NoCallerError, An as PEER_BYTES_MAX_OUTSTANDING, Bi as UnindexedFilterError, Bn as EntryDescriptorSchema, Cn as clearKnownSecrets, Cr as normalizeAddonInitResult, Di as FilterRequiredError, Dn as scrubKnownSecrets, Ea as findMigrationsBlocked, Ei as DeclarationRefusedError, En as registerKnownSecret, Et as createDebugEmitter, F as withoutCallerStamp, Fi as RecordTooLargeError, Fn as DATAPLANE_SECRET_HEADER, Fr as resolveDeviceSettings, G as readNodePin, Gn as RecordRetentionSchema, Gr as secretViewsOf, H as commandOrigin, Hi as asRecordsError, Hn as RecordIndexSchema, I as customAction, Ii as RecordUniqueViolationError, Ir as resolvedValues, J as PipelineRunResultBridge, Jn as declarationsOf, Jr as mapSecretLeaves, Kn as StoredRecordKindDeclarationSchema, Kr as REMOVE_LEAF, L as defineCustomActions, Li as RecordsError, Ln as DisposerChain, Mi as RECORDS_ERROR_CODES, Mn as PEER_BYTES_TICKET_TTL_MS, N as CAP_STATE_LEAVES, Ni as RecordNotFoundError, Nr as SCOPED_SETTINGS_SCOPES, O as HF_REPO, Oi as ForeignSecretMarkerError, On as shortSecretRefHash, P as CALLER_STAMPED_CAPABILITIES, Pi as RecordSecretUnavailableError, Pn as CALLER_USERNAME_HEADER, Pr as nodeIdOfScopedKey, Q as deviceOpsCapability, Qn as isZodSecret, Qr as recordSecretRef, R as describeCustomActions, Ri as RevConflictError, Rn as defineEntryKind, Sn as MIN_SCRUBBED_LENGTH, T as isCommand, Ta as AddonMigrationsBlockedError, Ti as BatchTooLargeError, Tn as knownSecretCount, U as nodePin, Ui as recordsErrorFromMessage, Un as RecordKindDeclarationSchema, Vi as UnknownRecordKindError, Vn as RecordFieldPathSchema, W as readCommandOrigin, Wn as RecordKindNameSchema, X as MIGRATION_API_VERSION, Xr as recordArrayItemPath, Y as PipelineStepInputSchema, Yn as defineRecordKinds, Yr as parseSecretPath, Zn as collectZodSecretPaths, Zr as recordSecretCollection, _a as toSecretFieldView, _i as formatSecretScope, _n as createRecordsAccess, ai as RECORD_DELETE_BATCH, bi as normalizeSecretOwner, bn as REVALIDATE_AFTER_MS, br as BaseAddon, c as asString, ci as RECORD_MAX_INDEXES, d as parseJsonUnknown, da as classifySecretWrite, di as RECORD_SECRET_COLLECTION_PREFIX, ea as emitReadiness, ei as RECORD_BATCH_MAX, et as adminUiCapability, f as hfModelUrl, fa as isSecretClear, fi as RECORD_SETTINGS_MAX_ROWS, g as createDeviceProxy, ga as makeSecretMarker, gi as buildSecretRef, gn as makeInMemoryRecords, h as isDeviceScopedCap, ha as isSecretMarkerLike, hi as arrayItemFieldPath, hn as ruleFireOfClaim, hr as ErrorI18nPayloadSchema, ht as ReadinessTimeoutError, ii as RECORD_DEFAULT_MAX_DATA_BYTES, j as CAP_METHOD_TIMEOUTS_MS, ji as PlaintextSecretError, jn as PEER_BYTES_STALL_MS, ki as InvalidRecordError, kn as PEER_BYTES_CHUNK_BYTES, li as RECORD_MAX_INDEX_FIELDS, m as DEVICE_SCOPED_CAPS, ma as isSecretMarker, mi as SECRET_REF_SCHEME, mn as RuleFireOriginSchema, mt as ReadinessRegistry, ni as RECORD_CLASSES, nt as addonPagesSourceCapability, o as asJsonObject, oi as RECORD_ID_MAX_LENGTH, or as expandCapMethods, p as BOOT_RECOVERY_BACKOFF_MS, pa as isSecretFieldView, pi as RECORD_SWEEP_INTERVAL_MS, pn as CommandOriginClaimSchema, pt as MODEL_FORMATS, q as viewerUiCapability, qn as assertValidDeclaration, qr as collectSecretLeaves, r as maskUrlCredentials, ri as RECORD_DATABASES, si as RECORD_MAX_DATA_BYTES, t as sleep, ti as RECORD_BATCH_MAX_BYTES, ua as SECRET_CLEAR, ui as RECORD_QUERY_MAX, v as addonSliceHandleApi, vi as globalSecretScope, vn as assertTransactScope, vr as readErrorI18n, vt as scopeKey, wn as forgetKnownSecret, xi as parseSecretRef, xn as createSecretsAccess, y as createEventBusSliceSource, yi as isSecretRef, yn as resolveSecretViewsIn, zi as TransactRefusedError, zn as entryBody } from "./sleep-BvVGLl30.mjs";
|
|
2
2
|
import { t as EventCategory } from "./event-category-Dv-Gcv1f.mjs";
|
|
3
|
-
import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-
|
|
3
|
+
import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-iddnCQ51.mjs";
|
|
4
4
|
//#region src/generated/cap-input-defaults.ts
|
|
5
5
|
/**
|
|
6
6
|
* AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
|
|
@@ -34,6 +34,14 @@ export declare const ActionTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
34
34
|
name: z.ZodString;
|
|
35
35
|
}, z.core.$strip>], "kind">;
|
|
36
36
|
export type ActionTarget = z.infer<typeof ActionTargetSchema>;
|
|
37
|
+
/**
|
|
38
|
+
* A STORED list of steps, read back: a `domain` target may name a device type
|
|
39
|
+
* D1033 retired (`thermostat`). The step schema stays a strict enum on the
|
|
40
|
+
* wire, so the store rewrites the retired name to its canonical type before
|
|
41
|
+
* it parses the row — on the step and on each step of its `else` list. Any
|
|
42
|
+
* other value is returned untouched, for the schema to judge.
|
|
43
|
+
*/
|
|
44
|
+
export declare function canonicalStoredStepTargets(steps: unknown): unknown;
|
|
37
45
|
/** What a resolver needs to know about one device. */
|
|
38
46
|
export interface DirectoryDevice {
|
|
39
47
|
readonly id: number;
|
|
@@ -357,6 +357,11 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
357
357
|
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
358
358
|
* device also has a fan cap (D1033). */
|
|
359
359
|
DeviceRole["SwitchFan"] = "switch-fan";
|
|
360
|
+
/** A relay driving an on/off-only lamp: drawn as a light (bulb and glow, no
|
|
361
|
+
* slider), presented to the exports as a light with power only. Not a
|
|
362
|
+
* `light` type: the provider owns the type, and a light implies brightness
|
|
363
|
+
* or colour this relay lacks. */
|
|
364
|
+
DeviceRole["SwitchLight"] = "switch-light";
|
|
360
365
|
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
361
366
|
DeviceRole["ClimateAc"] = "climate-ac";
|
|
362
367
|
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
@@ -357,6 +357,11 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
357
357
|
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
358
358
|
* device also has a fan cap (D1033). */
|
|
359
359
|
DeviceRole["SwitchFan"] = "switch-fan";
|
|
360
|
+
/** A relay driving an on/off-only lamp: drawn as a light (bulb and glow, no
|
|
361
|
+
* slider), presented to the exports as a light with power only. Not a
|
|
362
|
+
* `light` type: the provider owns the type, and a light implies brightness
|
|
363
|
+
* or colour this relay lacks. */
|
|
364
|
+
DeviceRole["SwitchLight"] = "switch-light";
|
|
360
365
|
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
361
366
|
DeviceRole["ClimateAc"] = "climate-ac";
|
|
362
367
|
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
@@ -831,6 +831,14 @@ export declare const CompositionNewTargetSchema: z.ZodObject<{
|
|
|
831
831
|
role: z.ZodOptional<z.ZodEnum<typeof DeviceRole>>;
|
|
832
832
|
}, z.core.$strip>;
|
|
833
833
|
export type CompositionNewTarget = z.infer<typeof CompositionNewTargetSchema>;
|
|
834
|
+
/**
|
|
835
|
+
* A STORED block, read back: the `new` target of its composition may name a
|
|
836
|
+
* device type D1033 retired (`thermostat`). {@link CompositionNewTargetSchema}
|
|
837
|
+
* stays a strict enum on the wire, so the store rewrites the retired name to
|
|
838
|
+
* its canonical type (`source.composition.target.type`) before it parses the
|
|
839
|
+
* row. Anything else is returned untouched, for the schema to judge.
|
|
840
|
+
*/
|
|
841
|
+
export declare function canonicalStoredBlockTarget(block: unknown): unknown;
|
|
834
842
|
/** Customize an EXISTING device: each feature adds a capability or replaces fields of a native one (D663). */
|
|
835
843
|
export declare const CompositionExistingTargetSchema: z.ZodObject<{
|
|
836
844
|
kind: z.ZodLiteral<"existing">;
|
|
@@ -9,5 +9,5 @@ export { KWH_PER_WATT_MS, wattMillisecondsToKwh } from './energy.js';
|
|
|
9
9
|
export { type HistoryValue, type IntegralScale, type SeriesBefore, type SeriesKind, type SeriesPoint, type SeriesRead, STATISTIC_STATS, SERIES_KINDS, evaluateDerivative, evaluateStatistic, integrateReading, } from './history-math.js';
|
|
10
10
|
export { type CalendarPeriod, type CalendarWindow, type HistoryRetention, type HistoryTier, type HistoryTierPlan, type OpenRange, type ResetPeriod, type RollingSpan, type RollingWindow, type StatisticWindow, CALENDAR_PERIODS, CalendarWindowSchema, DAY_MS, DEFAULT_HISTORY_RETENTION, historyRetentionFromSettings, HISTORY_FAST_MS, HISTORY_SLOW_MS, HISTORY_TIERS, HOUR_MS, MINUTE_MS, MIN_CUSTOM_MINUTES, RESET_PERIODS, ROLLING_SPANS, RollingWindowSchema, StatisticWindowSchema, integralCadenceMs, maxDurationMs, nextLocalMidnight, openReset, openStatistic, planResetTier, planStatisticTier, rollingDurationMs, statisticCadenceMs, } from './history-window.js';
|
|
11
11
|
export { type HelperMemberFact, helperSaveProblems, } from './save.js';
|
|
12
|
-
export { type SourcePick, type SourcePickAccept, type SourcePickFieldChoice, type SourcePickHistory, type SourcePickRequest, type MathSourceKind, sourcePickForHistory, sourcePickForMath, sourcePickForTemplate, } from './source-pick.js';
|
|
12
|
+
export { type SourcePick, type SourcePickAccept, type SourcePickFieldChoice, type SourcePickHistory, type SourcePickRequest, type MathSourceKind, sourcePickForHistory, sourcePickForMath, sourcePickAcceptsDevice, sourcePickForTemplate, } from './source-pick.js';
|
|
13
13
|
export { ACTIVE_CRITERIA, AGGREGATE_REDUCERS, ActiveCriterionSchema, AggregateReducerSchema, BINARY_AGGREGATES, GROUP_TEMPLATE_IDS, ARITHMETIC_OPS, ArithmeticHelperSpecSchema, DERIVATIVE_UNITS, DerivativeHelperSpecSchema, EXPRESSION_OUTPUTS, ExpressionHelperSpecSchema, ThresholdHelperSpecSchema, GroupHelperSpecSchema, GroupTemplateIdSchema, HelperMemberSchema, HelperSpecSchema, INTEGRAL_OUTPUTS, IntegralHelperSpecSchema, MAX_HELPER_MEMBERS, helperMembers, isHistoryHelper, NUMERIC_AGGREGATES, StatisticHelperSpecSchema, type ActiveCriterion, type AggregateReducer, type BinaryAggregate, type ArithmeticHelperSpec, type ArithmeticOp, type DerivativeHelperSpec, type DerivativeUnit, type ExpressionHelperSpec, type ExpressionInput, type ExpressionOutput, type ThresholdHelperSpec, type GroupHelperSpec, type GroupTemplateId, type HelperMember, type HelperSpec, type HistoryHelperSpec, type IntegralHelperSpec, type IntegralOutput, type NumericAggregate, type StatisticHelperSpec, type StatisticStat, } from './spec.js';
|
|
@@ -9,6 +9,8 @@ import type { CompositionProblem } from '../composition-report.js';
|
|
|
9
9
|
/** What a save learned about one member device. Absent keys were not read. */
|
|
10
10
|
export interface HelperMemberFact {
|
|
11
11
|
readonly deviceType?: DeviceType;
|
|
12
|
+
/** The member's role, when read: a `switch-light` relay is a light member. */
|
|
13
|
+
readonly role?: string | null;
|
|
12
14
|
readonly quantity?: ReadingQuantity;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The request the common source selector (#236) accepts for a helper (D944 §5).
|
|
3
|
-
* The selector's layout is not specified here. Groups ask for one device type
|
|
4
|
-
* and the catalog field; they do not opt into incompatible fields.
|
|
5
|
-
*/
|
|
6
1
|
import { DeviceType } from '../../device/device-type.js';
|
|
7
2
|
import type { CompositionSourceRef } from '../source-ref.js';
|
|
8
3
|
import type { GroupTemplate } from './catalog.js';
|
|
@@ -43,6 +38,17 @@ export interface SourcePick {
|
|
|
43
38
|
readonly compatibility: 'direct' | 'convert' | 'incompatible';
|
|
44
39
|
readonly history: 'recorded' | 'absent' | 'unknown';
|
|
45
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Does a device of this type and role answer the request's device types?
|
|
43
|
+
*
|
|
44
|
+
* The one gate both the member picker and the save use. No types = any device.
|
|
45
|
+
* A relay driving a lamp (`switch-light`) is a switch AND a light member: it
|
|
46
|
+
* joins a light group with its on/off only, and a command it cannot do
|
|
47
|
+
* (brightness, colour) skips it like any member that lacks the cap.
|
|
48
|
+
*/
|
|
49
|
+
export declare function sourcePickAcceptsDevice(request: Pick<SourcePickRequest, 'deviceTypes'>, deviceType: string, role: string | null | undefined): boolean;
|
|
50
|
+
/** `sourcePickAcceptsDevice` over a bare list of member types. */
|
|
51
|
+
export declare function memberKindAccepted(allowed: readonly DeviceType[], deviceType: string, role: string | null | undefined): boolean;
|
|
46
52
|
/** What the member step asks the selector for this template. */
|
|
47
53
|
export declare function sourcePickForTemplate(template: GroupTemplate): SourcePickRequest;
|
|
48
54
|
/** A statistic or integral reads one field that declares history. */
|
|
@@ -26,6 +26,8 @@ export interface CompositionSourceFound {
|
|
|
26
26
|
readonly caps: ReadonlySet<string>;
|
|
27
27
|
/** Present when the row was read. A helper group requires this one type. */
|
|
28
28
|
readonly deviceType?: DeviceType;
|
|
29
|
+
/** The row's role, when read: a `switch-light` relay joins a light group. */
|
|
30
|
+
readonly role?: string | null;
|
|
29
31
|
/** Present when the device declares one. Mixed quantities are refused. */
|
|
30
32
|
readonly quantity?: ReadingQuantity;
|
|
31
33
|
/**
|
|
@@ -5,9 +5,23 @@
|
|
|
5
5
|
* `switch-heater`; an air conditioner and a radiator valve are both `climate`,
|
|
6
6
|
* told apart by their `climate-*` role.
|
|
7
7
|
*/
|
|
8
|
+
import { z } from 'zod';
|
|
8
9
|
import { DeviceRole, DeviceType } from './device-type.js';
|
|
9
10
|
/** The live type a stored `type` value stands for (itself unless retired). */
|
|
10
11
|
export declare function canonicalStoredDeviceType(stored: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* The schema for a device type read back from STORAGE — a device config, a
|
|
14
|
+
* container's `entities[]`, a persisted identity. A retired type is read as its
|
|
15
|
+
* live type before the enum check, so a type retired after the record was
|
|
16
|
+
* written never fails the parse and never drops the device (D1033).
|
|
17
|
+
*
|
|
18
|
+
* Never on a schema that is also a WIRE input: a preprocess makes its input
|
|
19
|
+
* type `unknown`, which loosens the generated client. A store whose row schema
|
|
20
|
+
* is a wire schema (a grant, an action, a composition, a notification rule)
|
|
21
|
+
* keeps it strict and rewrites the row with {@link canonicalStoredDeviceType}
|
|
22
|
+
* where it reads the row back.
|
|
23
|
+
*/
|
|
24
|
+
export declare const StoredDeviceTypeSchema: z.ZodPreprocess<z.ZodEnum<typeof DeviceType>>;
|
|
11
25
|
/** The `climate-*` roles, in the order the role picker lists them. */
|
|
12
26
|
export declare const CLIMATE_ROLES: readonly DeviceRole[];
|
|
13
27
|
export type ClimateRole = DeviceRole.ClimateThermostat | DeviceRole.ClimateAc | DeviceRole.ClimateRadiator | DeviceRole.ClimateFloor | DeviceRole.ClimateHeater | DeviceRole.ClimateHeatPumpCircuit;
|
|
@@ -19,6 +33,28 @@ export type ClimateRole = DeviceRole.ClimateThermostat | DeviceRole.ClimateAc |
|
|
|
19
33
|
export declare function climateRoleOf(role: string | null | undefined): ClimateRole;
|
|
20
34
|
/** An air conditioner: exports present it as an AC unit, not a thermostat. */
|
|
21
35
|
export declare function isAirConditioner(type: string, role: string | null | undefined): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* A relay driving an on/off-only lamp (a `switch` with role `switch-light`):
|
|
38
|
+
* drawn and exported as a light, with the switch's power only. The one place
|
|
39
|
+
* that reads the role for it — a consumer asks this, never the role string.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isSwitchLight(type: string, role: string | null | undefined): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* A smart plug (a `switch` with role `outlet`, D875): exported as a plug /
|
|
44
|
+
* outlet. Exports ask this, never the role string.
|
|
45
|
+
*/
|
|
46
|
+
export declare function isOutlet(type: string, role: string | null | undefined): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* A plain fan behind a switch (a `switch` with role `switch-fan`): exported as
|
|
49
|
+
* a fan with the switch's on/off only — no speed it does not have.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isSwitchFan(type: string, role: string | null | undefined): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* A plug-in heater behind a switch (a `switch` with role `switch-heater`): it
|
|
54
|
+
* has power only, no setpoint and no room temperature, so an export never
|
|
55
|
+
* presents it as a thermostat.
|
|
56
|
+
*/
|
|
57
|
+
export declare function isSwitchHeater(type: string, role: string | null | undefined): boolean;
|
|
22
58
|
/** The part of a capability definition that says which devices it is offered on. */
|
|
23
59
|
export interface DeviceKindGate {
|
|
24
60
|
readonly deviceTypes?: readonly DeviceType[];
|
|
@@ -339,6 +339,11 @@ export declare enum DeviceRole {
|
|
|
339
339
|
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
340
340
|
* device also has a fan cap (D1033). */
|
|
341
341
|
SwitchFan = "switch-fan",
|
|
342
|
+
/** A relay driving an on/off-only lamp: drawn as a light (bulb and glow, no
|
|
343
|
+
* slider), presented to the exports as a light with power only. Not a
|
|
344
|
+
* `light` type: the provider owns the type, and a light implies brightness
|
|
345
|
+
* or colour this relay lacks. */
|
|
346
|
+
SwitchLight = "switch-light",
|
|
342
347
|
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
343
348
|
ClimateAc = "climate-ac",
|
|
344
349
|
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
@@ -265,6 +265,12 @@ export declare const HERO_LOOK_BY_ROLE: {
|
|
|
265
265
|
background: "alert-wash" | "cool-fall" | "drum" | "glow" | "heat-rise" | "mist" | "plain" | "sky" | "water";
|
|
266
266
|
animation: "blink" | "breathe" | "equalizer" | "fall" | "glow" | "halo" | "none" | "pulse" | "rise" | "spin" | "tumble" | "wave";
|
|
267
267
|
}>>;
|
|
268
|
+
readonly "switch-light": Readonly<Record<"alert" | "idle" | "off" | "offline" | "on" | "running" | "standby" | "unknown", {
|
|
269
|
+
icon: "a-arrow-down" | "a-arrow-up" | "a-large-small" | "accessibility" | "activity" | "air-vent" | "airplay" | "alarm-clock" | "alarm-clock-check" | "alarm-clock-minus" | "alarm-clock-off" | "alarm-clock-plus" | "alarm-smoke" | "album" | "align-center-horizontal" | "align-center-vertical" | "align-end-horizontal" | "align-end-vertical" | "align-horizontal-distribute-center" | "align-horizontal-distribute-end" | "align-horizontal-distribute-start" | "align-horizontal-justify-center" | "align-horizontal-justify-end" | "align-horizontal-justify-start" | "align-horizontal-space-around" | "align-horizontal-space-between" | "align-start-horizontal" | "align-start-vertical" | "align-vertical-distribute-center" | "align-vertical-distribute-end" | "align-vertical-distribute-start" | "align-vertical-justify-center" | "align-vertical-justify-end" | "align-vertical-justify-start" | "align-vertical-space-around" | "align-vertical-space-between" | "ambulance" | "ampersand" | "ampersands" | "amphora" | "anchor" | "angry" | "annoyed" | "antenna" | "anvil" | "aperture" | "app-window" | "app-window-mac" | "apple" | "archive" | "archive-restore" | "archive-x" | "armchair" | "arrow-big-down" | "arrow-big-down-dash" | "arrow-big-left" | "arrow-big-left-dash" | "arrow-big-right" | "arrow-big-right-dash" | "arrow-big-up" | "arrow-big-up-dash" | "arrow-down" | "arrow-down-0-1" | "arrow-down-1-0" | "arrow-down-a-z" | "arrow-down-from-line" | "arrow-down-left" | "arrow-down-narrow-wide" | "arrow-down-right" | "arrow-down-to-dot" | "arrow-down-to-line" | "arrow-down-up" | "arrow-down-wide-narrow" | "arrow-down-z-a" | "arrow-left" | "arrow-left-from-line" | "arrow-left-right" | "arrow-left-to-line" | "arrow-right" | "arrow-right-from-line" | "arrow-right-left" | "arrow-right-to-line" | "arrow-up" | "arrow-up-0-1" | "arrow-up-1-0" | "arrow-up-a-z" | "arrow-up-down" | "arrow-up-from-dot" | "arrow-up-from-line" | "arrow-up-left" | "arrow-up-narrow-wide" | "arrow-up-right" | "arrow-up-to-line" | "arrow-up-wide-narrow" | "arrow-up-z-a" | "arrows-up-from-line" | "asterisk" | "at-sign" | "atom" | "audio-lines" | "audio-waveform" | "award" | "axe" | "axis-3d" | "baby" | "backpack" | "badge" | "badge-alert" | "badge-cent" | "badge-check" | "badge-dollar-sign" | "badge-euro" | "badge-indian-rupee" | "badge-info" | "badge-japanese-yen" | "badge-minus" | "badge-percent" | "badge-plus" | "badge-pound-sterling" | "badge-question-mark" | "badge-russian-ruble" | "badge-swiss-franc" | "badge-turkish-lira" | "badge-x" | "baggage-claim" | "balloon" | "ban" | "banana" | "bandage" | "banknote" | "banknote-arrow-down" | "banknote-arrow-up" | "banknote-x" | "barcode" | "barrel" | "baseline" | "bath" | "battery" | "battery-charging" | "battery-full" | "battery-low" | "battery-medium" | "battery-plus" | "battery-warning" | "beaker" | "bean" | "bean-off" | "bed" | "bed-double" | "bed-single" | "beef" | "beer" | "beer-off" | "bell" | "bell-dot" | "bell-electric" | "bell-minus" | "bell-off" | "bell-plus" | "bell-ring" | "between-horizontal-end" | "between-horizontal-start" | "between-vertical-end" | "between-vertical-start" | "biceps-flexed" | "bike" | "binary" | "binoculars" | "biohazard" | "bird" | "birdhouse" | "bitcoin" | "blend" | "blinds" | "blocks" | "bluetooth" | "bluetooth-connected" | "bluetooth-off" | "bluetooth-searching" | "bold" | "bolt" | "bomb" | "bone" | "book" | "book-a" | "book-alert" | "book-audio" | "book-check" | "book-copy" | "book-dashed" | "book-down" | "book-headphones" | "book-heart" | "book-image" | "book-key" | "book-lock" | "book-marked" | "book-minus" | "book-open" | "book-open-check" | "book-open-text" | "book-plus" | "book-search" | "book-text" | "book-type" | "book-up" | "book-up-2" | "book-user" | "book-x" | "bookmark" | "bookmark-check" | "bookmark-minus" | "bookmark-plus" | "bookmark-x" | "boom-box" | "bot" | "bot-message-square" | "bot-off" | "bottle-wine" | "bow-arrow" | "box" | "boxes" | "braces" | "brackets" | "brain" | "brain-circuit" | "brain-cog" | "brick-wall" | "brick-wall-fire" | "brick-wall-shield" | "briefcase" | "briefcase-business" | "briefcase-conveyor-belt" | "briefcase-medical" | "bring-to-front" | "brush" | "brush-cleaning" | "bubbles" | "bug" | "bug-off" | "bug-play" | "building" | "building-2" | "bus" | "bus-front" | "cable" | "cable-car" | "cake" | "cake-slice" | "calculator" | "calendar" | "calendar-1" | "calendar-arrow-down" | "calendar-arrow-up" | "calendar-check" | "calendar-check-2" | "calendar-clock" | "calendar-cog" | "calendar-days" | "calendar-fold" | "calendar-heart" | "calendar-minus" | "calendar-minus-2" | "calendar-off" | "calendar-plus" | "calendar-plus-2" | "calendar-range" | "calendar-search" | "calendar-sync" | "calendar-x" | "calendar-x-2" | "calendars" | "camera" | "camera-off" | "candy" | "candy-cane" | "candy-off" | "cannabis" | "cannabis-off" | "captions" | "captions-off" | "car" | "car-front" | "car-taxi-front" | "caravan" | "card-sim" | "carrot" | "case-lower" | "case-sensitive" | "case-upper" | "cassette-tape" | "cast" | "castle" | "cat" | "cctv" | "chart-area" | "chart-bar" | "chart-bar-big" | "chart-bar-decreasing" | "chart-bar-increasing" | "chart-bar-stacked" | "chart-candlestick" | "chart-column" | "chart-column-big" | "chart-column-decreasing" | "chart-column-increasing" | "chart-column-stacked" | "chart-gantt" | "chart-line" | "chart-network" | "chart-no-axes-column" | "chart-no-axes-column-decreasing" | "chart-no-axes-column-increasing" | "chart-no-axes-combined" | "chart-no-axes-gantt" | "chart-pie" | "chart-scatter" | "chart-spline" | "check" | "check-check" | "check-line" | "chef-hat" | "cherry" | "chess-bishop" | "chess-king" | "chess-knight" | "chess-pawn" | "chess-queen" | "chess-rook" | "chevron-down" | "chevron-first" | "chevron-last" | "chevron-left" | "chevron-right" | "chevron-up" | "chevrons-down" | "chevrons-down-up" | "chevrons-left" | "chevrons-left-right" | "chevrons-left-right-ellipsis" | "chevrons-right" | "chevrons-right-left" | "chevrons-up" | "chevrons-up-down" | "church" | "cigarette" | "cigarette-off" | "circle" | "circle-alert" | "circle-arrow-down" | "circle-arrow-left" | "circle-arrow-out-down-left" | "circle-arrow-out-down-right" | "circle-arrow-out-up-left" | "circle-arrow-out-up-right" | "circle-arrow-right" | "circle-arrow-up" | "circle-check" | "circle-check-big" | "circle-chevron-down" | "circle-chevron-left" | "circle-chevron-right" | "circle-chevron-up" | "circle-dashed" | "circle-divide" | "circle-dollar-sign" | "circle-dot" | "circle-dot-dashed" | "circle-ellipsis" | "circle-equal" | "circle-fading-arrow-up" | "circle-fading-plus" | "circle-gauge" | "circle-minus" | "circle-off" | "circle-parking" | "circle-parking-off" | "circle-pause" | "circle-percent" | "circle-pile" | "circle-play" | "circle-plus" | "circle-pound-sterling" | "circle-power" | "circle-question-mark" | "circle-slash" | "circle-slash-2" | "circle-small" | "circle-star" | "circle-stop" | "circle-user" | "circle-user-round" | "circle-x" | "circuit-board" | "citrus" | "clapperboard" | "clipboard" | "clipboard-check" | "clipboard-clock" | "clipboard-copy" | "clipboard-list" | "clipboard-minus" | "clipboard-paste" | "clipboard-pen" | "clipboard-pen-line" | "clipboard-plus" | "clipboard-type" | "clipboard-x" | "clock" | "clock-1" | "clock-10" | "clock-11" | "clock-12" | "clock-2" | "clock-3" | "clock-4" | "clock-5" | "clock-6" | "clock-7" | "clock-8" | "clock-9" | "clock-alert" | "clock-arrow-down" | "clock-arrow-up" | "clock-check" | "clock-fading" | "clock-plus" | "closed-caption" | "cloud" | "cloud-alert" | "cloud-backup" | "cloud-check" | "cloud-cog" | "cloud-download" | "cloud-drizzle" | "cloud-fog" | "cloud-hail" | "cloud-lightning" | "cloud-moon" | "cloud-moon-rain" | "cloud-off" | "cloud-rain" | "cloud-rain-wind" | "cloud-snow" | "cloud-sun" | "cloud-sun-rain" | "cloud-sync" | "cloud-upload" | "cloudy" | "clover" | "club" | "code" | "code-xml" | "coffee" | "cog" | "coins" | "columns-2" | "columns-3" | "columns-3-cog" | "columns-4" | "combine" | "command" | "compass" | "component" | "computer" | "concierge-bell" | "cone" | "construction" | "contact" | "contact-round" | "container" | "contrast" | "cookie" | "cooking-pot" | "copy" | "copy-check" | "copy-minus" | "copy-plus" | "copy-slash" | "copy-x" | "copyleft" | "copyright" | "corner-down-left" | "corner-down-right" | "corner-left-down" | "corner-left-up" | "corner-right-down" | "corner-right-up" | "corner-up-left" | "corner-up-right" | "cpu" | "creative-commons" | "credit-card" | "croissant" | "crop" | "cross" | "crosshair" | "crown" | "cuboid" | "cup-soda" | "currency" | "cylinder" | "dam" | "database" | "database-backup" | "database-search" | "database-zap" | "decimals-arrow-left" | "decimals-arrow-right" | "delete" | "dessert" | "diameter" | "diamond" | "diamond-minus" | "diamond-percent" | "diamond-plus" | "dice-1" | "dice-2" | "dice-3" | "dice-4" | "dice-5" | "dice-6" | "dices" | "diff" | "disc" | "disc-2" | "disc-3" | "disc-album" | "divide" | "dna" | "dna-off" | "dock" | "dog" | "dollar-sign" | "donut" | "door-closed" | "door-closed-locked" | "door-open" | "dot" | "download" | "drafting-compass" | "drama" | "drill" | "drone" | "droplet" | "droplet-off" | "droplets" | "drum" | "drumstick" | "dumbbell" | "ear" | "ear-off" | "earth" | "earth-lock" | "eclipse" | "egg" | "egg-fried" | "egg-off" | "ellipsis" | "ellipsis-vertical" | "equal" | "equal-approximately" | "equal-not" | "eraser" | "ethernet-port" | "euro" | "ev-charger" | "expand" | "external-link" | "eye" | "eye-closed" | "eye-off" | "factory" | "fan" | "fast-forward" | "feather" | "fence" | "ferris-wheel" | "file" | "file-archive" | "file-axis-3d" | "file-badge" | "file-box" | "file-braces" | "file-braces-corner" | "file-chart-column" | "file-chart-column-increasing" | "file-chart-line" | "file-chart-pie" | "file-check" | "file-check-corner" | "file-clock" | "file-code" | "file-code-corner" | "file-cog" | "file-diff" | "file-digit" | "file-down" | "file-exclamation-point" | "file-headphone" | "file-heart" | "file-image" | "file-input" | "file-key" | "file-lock" | "file-minus" | "file-minus-corner" | "file-music" | "file-output" | "file-pen" | "file-pen-line" | "file-play" | "file-plus" | "file-plus-corner" | "file-question-mark" | "file-scan" | "file-search" | "file-search-corner" | "file-signal" | "file-sliders" | "file-spreadsheet" | "file-stack" | "file-symlink" | "file-terminal" | "file-text" | "file-type" | "file-type-corner" | "file-up" | "file-user" | "file-video-camera" | "file-volume" | "file-x" | "file-x-corner" | "files" | "film" | "fingerprint-pattern" | "fire-extinguisher" | "fish" | "fish-off" | "fish-symbol" | "fishing-hook" | "fishing-rod" | "flag" | "flag-off" | "flag-triangle-left" | "flag-triangle-right" | "flame" | "flame-kindling" | "flashlight" | "flashlight-off" | "flask-conical" | "flask-conical-off" | "flask-round" | "flip-horizontal-2" | "flip-vertical-2" | "flower" | "flower-2" | "focus" | "fold-horizontal" | "fold-vertical" | "folder" | "folder-archive" | "folder-check" | "folder-clock" | "folder-closed" | "folder-code" | "folder-cog" | "folder-dot" | "folder-down" | "folder-git" | "folder-git-2" | "folder-heart" | "folder-input" | "folder-kanban" | "folder-key" | "folder-lock" | "folder-minus" | "folder-open" | "folder-open-dot" | "folder-output" | "folder-pen" | "folder-plus" | "folder-root" | "folder-search" | "folder-search-2" | "folder-symlink" | "folder-sync" | "folder-tree" | "folder-up" | "folder-x" | "folders" | "footprints" | "forklift" | "form" | "forward" | "frame" | "frown" | "fuel" | "fullscreen" | "funnel" | "funnel-plus" | "funnel-x" | "gallery-horizontal" | "gallery-horizontal-end" | "gallery-thumbnails" | "gallery-vertical" | "gallery-vertical-end" | "gamepad" | "gamepad-2" | "gamepad-directional" | "gauge" | "gavel" | "gem" | "georgian-lari" | "ghost" | "gift" | "git-branch" | "git-branch-minus" | "git-branch-plus" | "git-commit-horizontal" | "git-commit-vertical" | "git-compare" | "git-compare-arrows" | "git-fork" | "git-graph" | "git-merge" | "git-merge-conflict" | "git-pull-request" | "git-pull-request-arrow" | "git-pull-request-closed" | "git-pull-request-create" | "git-pull-request-create-arrow" | "git-pull-request-draft" | "glass-water" | "glasses" | "globe" | "globe-lock" | "globe-off" | "globe-x" | "goal" | "gpu" | "graduation-cap" | "grape" | "grid-2x2" | "grid-2x2-check" | "grid-2x2-plus" | "grid-2x2-x" | "grid-3x2" | "grid-3x3" | "grip" | "grip-horizontal" | "grip-vertical" | "group" | "guitar" | "ham" | "hamburger" | "hammer" | "hand" | "hand-coins" | "hand-fist" | "hand-grab" | "hand-heart" | "hand-helping" | "hand-metal" | "hand-platter" | "handbag" | "handshake" | "hard-drive" | "hard-drive-download" | "hard-drive-upload" | "hard-hat" | "hash" | "hat-glasses" | "haze" | "hd" | "hdmi-port" | "heading" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "headphone-off" | "headphones" | "headset" | "heart" | "heart-crack" | "heart-handshake" | "heart-minus" | "heart-off" | "heart-plus" | "heart-pulse" | "heater" | "helicopter" | "hexagon" | "highlighter" | "history" | "hop" | "hop-off" | "hospital" | "hotel" | "hourglass" | "house" | "house-heart" | "house-plug" | "house-plus" | "house-wifi" | "ice-cream-bowl" | "ice-cream-cone" | "id-card" | "id-card-lanyard" | "image" | "image-down" | "image-minus" | "image-off" | "image-play" | "image-plus" | "image-up" | "image-upscale" | "images" | "import" | "inbox" | "indian-rupee" | "infinity" | "info" | "inspection-panel" | "italic" | "iteration-ccw" | "iteration-cw" | "japanese-yen" | "joystick" | "kanban" | "kayak" | "key" | "key-round" | "key-square" | "keyboard" | "keyboard-music" | "keyboard-off" | "lamp" | "lamp-ceiling" | "lamp-desk" | "lamp-floor" | "lamp-wall-down" | "lamp-wall-up" | "land-plot" | "landmark" | "languages" | "laptop" | "laptop-minimal" | "laptop-minimal-check" | "lasso" | "lasso-select" | "laugh" | "layers" | "layers-2" | "layers-plus" | "layout-dashboard" | "layout-grid" | "layout-list" | "layout-panel-left" | "layout-panel-top" | "layout-template" | "leaf" | "leafy-green" | "lectern" | "lens-concave" | "lens-convex" | "library" | "library-big" | "life-buoy" | "ligature" | "lightbulb" | "lightbulb-off" | "line-dot-right-horizontal" | "line-squiggle" | "link" | "link-2" | "link-2-off" | "list" | "list-check" | "list-checks" | "list-chevrons-down-up" | "list-chevrons-up-down" | "list-collapse" | "list-end" | "list-filter" | "list-filter-plus" | "list-indent-decrease" | "list-indent-increase" | "list-minus" | "list-music" | "list-ordered" | "list-plus" | "list-restart" | "list-start" | "list-todo" | "list-tree" | "list-video" | "list-x" | "loader" | "loader-circle" | "loader-pinwheel" | "locate" | "locate-fixed" | "locate-off" | "lock" | "lock-keyhole" | "lock-keyhole-open" | "lock-open" | "log-in" | "log-out" | "logs" | "lollipop" | "luggage" | "magnet" | "mail" | "mail-check" | "mail-minus" | "mail-open" | "mail-plus" | "mail-question-mark" | "mail-search" | "mail-warning" | "mail-x" | "mailbox" | "mails" | "map" | "map-minus" | "map-pin" | "map-pin-check" | "map-pin-check-inside" | "map-pin-house" | "map-pin-minus" | "map-pin-minus-inside" | "map-pin-off" | "map-pin-pen" | "map-pin-plus" | "map-pin-plus-inside" | "map-pin-x" | "map-pin-x-inside" | "map-pinned" | "map-plus" | "mars" | "mars-stroke" | "martini" | "maximize" | "maximize-2" | "medal" | "megaphone" | "megaphone-off" | "meh" | "memory-stick" | "menu" | "merge" | "message-circle" | "message-circle-check" | "message-circle-code" | "message-circle-dashed" | "message-circle-heart" | "message-circle-more" | "message-circle-off" | "message-circle-plus" | "message-circle-question-mark" | "message-circle-reply" | "message-circle-warning" | "message-circle-x" | "message-square" | "message-square-check" | "message-square-code" | "message-square-dashed" | "message-square-diff" | "message-square-dot" | "message-square-heart" | "message-square-lock" | "message-square-more" | "message-square-off" | "message-square-plus" | "message-square-quote" | "message-square-reply" | "message-square-share" | "message-square-text" | "message-square-warning" | "message-square-x" | "messages-square" | "metronome" | "mic" | "mic-off" | "mic-vocal" | "microchip" | "microscope" | "microwave" | "milestone" | "milk" | "milk-off" | "minimize" | "minimize-2" | "minus" | "mirror-rectangular" | "mirror-round" | "monitor" | "monitor-check" | "monitor-cloud" | "monitor-cog" | "monitor-dot" | "monitor-down" | "monitor-off" | "monitor-pause" | "monitor-play" | "monitor-smartphone" | "monitor-speaker" | "monitor-stop" | "monitor-up" | "monitor-x" | "moon" | "moon-star" | "motorbike" | "mountain" | "mountain-snow" | "mouse" | "mouse-left" | "mouse-off" | "mouse-pointer" | "mouse-pointer-2" | "mouse-pointer-2-off" | "mouse-pointer-ban" | "mouse-pointer-click" | "mouse-right" | "move" | "move-3d" | "move-diagonal" | "move-diagonal-2" | "move-down" | "move-down-left" | "move-down-right" | "move-horizontal" | "move-left" | "move-right" | "move-up" | "move-up-left" | "move-up-right" | "move-vertical" | "music" | "music-2" | "music-3" | "music-4" | "navigation" | "navigation-2" | "navigation-2-off" | "navigation-off" | "network" | "newspaper" | "nfc" | "non-binary" | "notebook" | "notebook-pen" | "notebook-tabs" | "notebook-text" | "notepad-text" | "notepad-text-dashed" | "nut" | "nut-off" | "octagon" | "octagon-alert" | "octagon-minus" | "octagon-pause" | "octagon-x" | "omega" | "option" | "orbit" | "origami" | "package" | "package-2" | "package-check" | "package-minus" | "package-open" | "package-plus" | "package-search" | "package-x" | "paint-bucket" | "paint-roller" | "paintbrush" | "paintbrush-vertical" | "palette" | "panda" | "panel-bottom" | "panel-bottom-close" | "panel-bottom-dashed" | "panel-bottom-open" | "panel-left" | "panel-left-close" | "panel-left-dashed" | "panel-left-open" | "panel-left-right-dashed" | "panel-right" | "panel-right-close" | "panel-right-dashed" | "panel-right-open" | "panel-top" | "panel-top-bottom-dashed" | "panel-top-close" | "panel-top-dashed" | "panel-top-open" | "panels-left-bottom" | "panels-right-bottom" | "panels-top-left" | "paperclip" | "parentheses" | "parking-meter" | "party-popper" | "pause" | "paw-print" | "pc-case" | "pen" | "pen-line" | "pen-off" | "pen-tool" | "pencil" | "pencil-line" | "pencil-off" | "pencil-ruler" | "pentagon" | "percent" | "person-standing" | "philippine-peso" | "phone" | "phone-call" | "phone-forwarded" | "phone-incoming" | "phone-missed" | "phone-off" | "phone-outgoing" | "pi" | "piano" | "pickaxe" | "picture-in-picture" | "picture-in-picture-2" | "piggy-bank" | "pilcrow" | "pilcrow-left" | "pilcrow-right" | "pill" | "pill-bottle" | "pin" | "pin-off" | "pipette" | "pizza" | "plane" | "plane-landing" | "plane-takeoff" | "play" | "plug" | "plug-2" | "plug-zap" | "plus" | "pocket-knife" | "podcast" | "pointer" | "pointer-off" | "popcorn" | "popsicle" | "pound-sterling" | "power" | "power-off" | "presentation" | "printer" | "printer-check" | "printer-x" | "projector" | "proportions" | "puzzle" | "pyramid" | "qr-code" | "quote" | "rabbit" | "radar" | "radiation" | "radical" | "radio" | "radio-receiver" | "radio-tower" | "radius" | "rainbow" | "rat" | "ratio" | "receipt" | "receipt-cent" | "receipt-euro" | "receipt-indian-rupee" | "receipt-japanese-yen" | "receipt-pound-sterling" | "receipt-russian-ruble" | "receipt-swiss-franc" | "receipt-text" | "receipt-turkish-lira" | "rectangle-circle" | "rectangle-ellipsis" | "rectangle-goggles" | "rectangle-horizontal" | "rectangle-vertical" | "recycle" | "redo" | "redo-2" | "redo-dot" | "refresh-ccw" | "refresh-ccw-dot" | "refresh-cw" | "refresh-cw-off" | "refrigerator" | "regex" | "remove-formatting" | "repeat" | "repeat-1" | "repeat-2" | "replace" | "replace-all" | "reply" | "reply-all" | "rewind" | "ribbon" | "rocket" | "rocking-chair" | "roller-coaster" | "rose" | "rotate-3d" | "rotate-ccw" | "rotate-ccw-key" | "rotate-ccw-square" | "rotate-cw" | "rotate-cw-square" | "route" | "route-off" | "router" | "rows-2" | "rows-3" | "rows-4" | "rss" | "ruler" | "ruler-dimension-line" | "russian-ruble" | "sailboat" | "salad" | "sandwich" | "satellite" | "satellite-dish" | "saudi-riyal" | "save" | "save-all" | "save-off" | "scale" | "scale-3d" | "scaling" | "scan" | "scan-barcode" | "scan-eye" | "scan-face" | "scan-heart" | "scan-line" | "scan-qr-code" | "scan-search" | "scan-text" | "school" | "scissors" | "scissors-line-dashed" | "scooter" | "screen-share" | "screen-share-off" | "scroll" | "scroll-text" | "search" | "search-alert" | "search-check" | "search-code" | "search-slash" | "search-x" | "section" | "send" | "send-horizontal" | "send-to-back" | "separator-horizontal" | "separator-vertical" | "server" | "server-cog" | "server-crash" | "server-off" | "settings" | "settings-2" | "shapes" | "share" | "share-2" | "sheet" | "shell" | "shelving-unit" | "shield" | "shield-alert" | "shield-ban" | "shield-check" | "shield-ellipsis" | "shield-half" | "shield-minus" | "shield-off" | "shield-plus" | "shield-question-mark" | "shield-user" | "shield-x" | "ship" | "ship-wheel" | "shirt" | "shopping-bag" | "shopping-basket" | "shopping-cart" | "shovel" | "shower-head" | "shredder" | "shrimp" | "shrink" | "shrub" | "shuffle" | "sigma" | "signal" | "signal-high" | "signal-low" | "signal-medium" | "signal-zero" | "signature" | "signpost" | "signpost-big" | "siren" | "skip-back" | "skip-forward" | "skull" | "slash" | "slice" | "sliders-horizontal" | "sliders-vertical" | "smartphone" | "smartphone-charging" | "smartphone-nfc" | "smile" | "smile-plus" | "snail" | "snowflake" | "soap-dispenser-droplet" | "sofa" | "solar-panel" | "soup" | "space" | "spade" | "sparkle" | "sparkles" | "speaker" | "speech" | "spell-check" | "spell-check-2" | "spline" | "spline-pointer" | "split" | "spool" | "spotlight" | "spray-can" | "sprout" | "square" | "square-activity" | "square-arrow-down" | "square-arrow-down-left" | "square-arrow-down-right" | "square-arrow-left" | "square-arrow-out-down-left" | "square-arrow-out-down-right" | "square-arrow-out-up-left" | "square-arrow-out-up-right" | "square-arrow-right" | "square-arrow-right-enter" | "square-arrow-right-exit" | "square-arrow-up" | "square-arrow-up-left" | "square-arrow-up-right" | "square-asterisk" | "square-bottom-dashed-scissors" | "square-centerline-dashed-horizontal" | "square-centerline-dashed-vertical" | "square-chart-gantt" | "square-check" | "square-check-big" | "square-chevron-down" | "square-chevron-left" | "square-chevron-right" | "square-chevron-up" | "square-code" | "square-dashed" | "square-dashed-bottom" | "square-dashed-bottom-code" | "square-dashed-kanban" | "square-dashed-mouse-pointer" | "square-dashed-top-solid" | "square-divide" | "square-dot" | "square-equal" | "square-function" | "square-kanban" | "square-library" | "square-m" | "square-menu" | "square-minus" | "square-mouse-pointer" | "square-parking" | "square-parking-off" | "square-pause" | "square-pen" | "square-percent" | "square-pi" | "square-pilcrow" | "square-play" | "square-plus" | "square-power" | "square-radical" | "square-round-corner" | "square-scissors" | "square-sigma" | "square-slash" | "square-split-horizontal" | "square-split-vertical" | "square-square" | "square-stack" | "square-star" | "square-stop" | "square-terminal" | "square-user" | "square-user-round" | "square-x" | "squares-exclude" | "squares-intersect" | "squares-subtract" | "squares-unite" | "squircle" | "squircle-dashed" | "squirrel" | "stamp" | "star" | "star-half" | "star-off" | "step-back" | "step-forward" | "stethoscope" | "sticker" | "sticky-note" | "stone" | "store" | "stretch-horizontal" | "stretch-vertical" | "strikethrough" | "subscript" | "sun" | "sun-dim" | "sun-medium" | "sun-moon" | "sun-snow" | "sunrise" | "sunset" | "superscript" | "swatch-book" | "swiss-franc" | "switch-camera" | "sword" | "swords" | "syringe" | "table" | "table-2" | "table-cells-merge" | "table-cells-split" | "table-columns-split" | "table-of-contents" | "table-properties" | "table-rows-split" | "tablet" | "tablet-smartphone" | "tablets" | "tag" | "tags" | "tally-1" | "tally-2" | "tally-3" | "tally-4" | "tally-5" | "tangent" | "target" | "telescope" | "tent" | "tent-tree" | "terminal" | "test-tube" | "test-tube-diagonal" | "test-tubes" | "text-align-center" | "text-align-end" | "text-align-justify" | "text-align-start" | "text-cursor" | "text-cursor-input" | "text-initial" | "text-quote" | "text-search" | "text-select" | "text-wrap" | "theater" | "thermometer" | "thermometer-snowflake" | "thermometer-sun" | "thumbs-down" | "thumbs-up" | "ticket" | "ticket-check" | "ticket-minus" | "ticket-percent" | "ticket-plus" | "ticket-slash" | "ticket-x" | "tickets" | "tickets-plane" | "timer" | "timer-off" | "timer-reset" | "toggle-left" | "toggle-right" | "toilet" | "tool-case" | "toolbox" | "tornado" | "torus" | "touchpad" | "touchpad-off" | "towel-rack" | "tower-control" | "toy-brick" | "tractor" | "traffic-cone" | "train-front" | "train-front-tunnel" | "train-track" | "tram-front" | "transgender" | "trash" | "trash-2" | "tree-deciduous" | "tree-palm" | "tree-pine" | "trees" | "trending-down" | "trending-up" | "trending-up-down" | "triangle" | "triangle-alert" | "triangle-dashed" | "triangle-right" | "trophy" | "truck" | "truck-electric" | "turkish-lira" | "turntable" | "turtle" | "tv" | "tv-minimal" | "tv-minimal-play" | "type" | "type-outline" | "umbrella" | "umbrella-off" | "underline" | "undo" | "undo-2" | "undo-dot" | "unfold-horizontal" | "unfold-vertical" | "ungroup" | "university" | "unlink" | "unlink-2" | "unplug" | "upload" | "usb" | "user" | "user-check" | "user-cog" | "user-key" | "user-lock" | "user-minus" | "user-pen" | "user-plus" | "user-round" | "user-round-check" | "user-round-cog" | "user-round-key" | "user-round-minus" | "user-round-pen" | "user-round-plus" | "user-round-search" | "user-round-x" | "user-search" | "user-star" | "user-x" | "users" | "users-round" | "utensils" | "utensils-crossed" | "utility-pole" | "van" | "variable" | "vault" | "vector-square" | "vegan" | "venetian-mask" | "venus" | "venus-and-mars" | "vibrate" | "vibrate-off" | "video" | "video-off" | "videotape" | "view" | "voicemail" | "volleyball" | "volume" | "volume-1" | "volume-2" | "volume-off" | "volume-x" | "vote" | "wallet" | "wallet-cards" | "wallet-minimal" | "wallpaper" | "wand" | "wand-sparkles" | "warehouse" | "washing-machine" | "watch" | "waves" | "waves-arrow-down" | "waves-arrow-up" | "waves-ladder" | "waypoints" | "webcam" | "webhook" | "webhook-off" | "weight" | "weight-tilde" | "wheat" | "wheat-off" | "whole-word" | "wifi" | "wifi-cog" | "wifi-high" | "wifi-low" | "wifi-off" | "wifi-pen" | "wifi-sync" | "wifi-zero" | "wind" | "wind-arrow-down" | "wine" | "wine-off" | "workflow" | "worm" | "wrench" | "x" | "x-line-top" | "zap" | "zap-off" | "zodiac-aquarius" | "zodiac-aries" | "zodiac-cancer" | "zodiac-capricorn" | "zodiac-gemini" | "zodiac-leo" | "zodiac-libra" | "zodiac-ophiuchus" | "zodiac-pisces" | "zodiac-sagittarius" | "zodiac-scorpio" | "zodiac-taurus" | "zodiac-virgo" | "zoom-in" | "zoom-out";
|
|
270
|
+
tone: "danger" | "info" | "muted" | "primary" | "success" | "warning";
|
|
271
|
+
background: "alert-wash" | "cool-fall" | "drum" | "glow" | "heat-rise" | "mist" | "plain" | "sky" | "water";
|
|
272
|
+
animation: "blink" | "breathe" | "equalizer" | "fall" | "glow" | "halo" | "none" | "pulse" | "rise" | "spin" | "tumble" | "wave";
|
|
273
|
+
}>>;
|
|
268
274
|
readonly "climate-ac": 'inherit';
|
|
269
275
|
readonly "climate-thermostat": 'inherit';
|
|
270
276
|
readonly "climate-floor": 'inherit';
|
|
@@ -172,6 +172,7 @@ export declare const HERO_SCENE_BY_ROLE: {
|
|
|
172
172
|
readonly outlet: 'plug';
|
|
173
173
|
readonly "switch-heater": 'heater';
|
|
174
174
|
readonly "switch-fan": 'fan';
|
|
175
|
+
readonly "switch-light": 'light';
|
|
175
176
|
readonly "climate-ac": 'ac';
|
|
176
177
|
readonly "climate-thermostat": 'inherit';
|
|
177
178
|
readonly "climate-floor": 'inherit';
|
package/dist/device/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type { DeviceProfile, DeviceProfileDefaults, DeviceProfileMatch, Pipeline
|
|
|
18
18
|
export { BATTERY_DEVICE_PROFILE, DEVICE_PROFILES, deviceMatchesProfile, resolveDeviceProfile, } from './device-profile.js';
|
|
19
19
|
export type { IDeviceRuntimeState, Snapshot as RuntimeStateSnapshot, } from './device-runtime-state.js';
|
|
20
20
|
export { ChargingStatus, DeviceFeature, DeviceRole, DeviceType, featuresOfBoundCaps, } from './device-type.js';
|
|
21
|
-
export { capAppliesToDeviceKind, canonicalStoredDeviceType, CLIMATE_ROLES, climateRoleOf, isAirConditioner, type ClimateRole, type DeviceKindGate, } from './device-kind.js';
|
|
21
|
+
export { capAppliesToDeviceKind, canonicalStoredDeviceType, CLIMATE_ROLES, StoredDeviceTypeSchema, climateRoleOf, isAirConditioner, isOutlet, isSwitchFan, isSwitchHeater, isSwitchLight, type ClimateRole, type DeviceKindGate, } from './device-kind.js';
|
|
22
22
|
export type { IBatteryOperated, IDoorbellButton, INativeSnapshot, IPanTiltZoom, IRebootable, ITwoWayAudio, } from './features.js';
|
|
23
23
|
export type { IconCategoryId, IconEntry, IconHit, IconKey, } from './icon-catalog.js';
|
|
24
24
|
export { ICON_CATALOG_SOURCE, ICON_CATEGORIES, ICON_ENTRIES, ICON_KEYS, ICON_VIEWER_MODULES, IconKeySchema, canonicalIconKey, iconCategoryLabel, iconEntry, iconsInCategory, isIconKey, resolveIconKey, searchIcons, } from './icon-catalog.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DeviceType, i as DeviceRole, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-
|
|
1
|
+
import { a as DeviceType, i as DeviceRole, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-iddnCQ51.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
//#region src/ffmpeg/invocation.ts
|
|
@@ -934,6 +934,116 @@ function chooseFfmpegBinary(input) {
|
|
|
934
934
|
return null;
|
|
935
935
|
}
|
|
936
936
|
//#endregion
|
|
937
|
+
//#region src/device/device-kind.ts
|
|
938
|
+
/**
|
|
939
|
+
* A device's KIND is its type plus its role (D1033): the type is the set of
|
|
940
|
+
* controls it has, the role says which thing it is among the devices that
|
|
941
|
+
* share those controls. A plug-in heater is a `switch` with role
|
|
942
|
+
* `switch-heater`; an air conditioner and a radiator valve are both `climate`,
|
|
943
|
+
* told apart by their `climate-*` role.
|
|
944
|
+
*/
|
|
945
|
+
/**
|
|
946
|
+
* Type values a persisted row may still carry after the type was retired, and
|
|
947
|
+
* the type each one is read as. The row is rewritten by the next registration
|
|
948
|
+
* of the device (its provider stamps the live type), so this is a read alias,
|
|
949
|
+
* not a migration.
|
|
950
|
+
*
|
|
951
|
+
* `heater` is deliberately absent: the only heaters were composed devices the
|
|
952
|
+
* operator deletes. Such a row stays an unknown type, which every reader
|
|
953
|
+
* treats as a generic device.
|
|
954
|
+
*/
|
|
955
|
+
var RETIRED_DEVICE_TYPES = { thermostat: DeviceType.Climate };
|
|
956
|
+
/** The live type a stored `type` value stands for (itself unless retired). */
|
|
957
|
+
function canonicalStoredDeviceType(stored) {
|
|
958
|
+
return RETIRED_DEVICE_TYPES[stored] ?? stored;
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* The schema for a device type read back from STORAGE — a device config, a
|
|
962
|
+
* container's `entities[]`, a persisted identity. A retired type is read as its
|
|
963
|
+
* live type before the enum check, so a type retired after the record was
|
|
964
|
+
* written never fails the parse and never drops the device (D1033).
|
|
965
|
+
*
|
|
966
|
+
* Never on a schema that is also a WIRE input: a preprocess makes its input
|
|
967
|
+
* type `unknown`, which loosens the generated client. A store whose row schema
|
|
968
|
+
* is a wire schema (a grant, an action, a composition, a notification rule)
|
|
969
|
+
* keeps it strict and rewrites the row with {@link canonicalStoredDeviceType}
|
|
970
|
+
* where it reads the row back.
|
|
971
|
+
*/
|
|
972
|
+
var StoredDeviceTypeSchema = z.preprocess((value) => typeof value === "string" ? canonicalStoredDeviceType(value) : value, z.enum(DeviceType));
|
|
973
|
+
/** The `climate-*` roles, in the order the role picker lists them. */
|
|
974
|
+
var CLIMATE_ROLES = [
|
|
975
|
+
DeviceRole.ClimateThermostat,
|
|
976
|
+
DeviceRole.ClimateAc,
|
|
977
|
+
DeviceRole.ClimateRadiator,
|
|
978
|
+
DeviceRole.ClimateFloor,
|
|
979
|
+
DeviceRole.ClimateHeater,
|
|
980
|
+
DeviceRole.ClimateHeatPumpCircuit
|
|
981
|
+
];
|
|
982
|
+
function isClimateRole(role) {
|
|
983
|
+
return CLIMATE_ROLES.some((candidate) => candidate === role);
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Which climate device this is. A climate device with no role, or a role that
|
|
987
|
+
* is not a climate one, is a room thermostat: that is what most of them are,
|
|
988
|
+
* and it is the presentation a thermostat had before the types were folded.
|
|
989
|
+
*/
|
|
990
|
+
function climateRoleOf(role) {
|
|
991
|
+
return role !== null && role !== void 0 && isClimateRole(role) ? role : DeviceRole.ClimateThermostat;
|
|
992
|
+
}
|
|
993
|
+
/** An air conditioner: exports present it as an AC unit, not a thermostat. */
|
|
994
|
+
function isAirConditioner(type, role) {
|
|
995
|
+
return type === DeviceType.Climate && climateRoleOf(role) === DeviceRole.ClimateAc;
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* A relay driving an on/off-only lamp (a `switch` with role `switch-light`):
|
|
999
|
+
* drawn and exported as a light, with the switch's power only. The one place
|
|
1000
|
+
* that reads the role for it — a consumer asks this, never the role string.
|
|
1001
|
+
*/
|
|
1002
|
+
function isSwitchLight(type, role) {
|
|
1003
|
+
return type === DeviceType.Switch && role === DeviceRole.SwitchLight;
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* A smart plug (a `switch` with role `outlet`, D875): exported as a plug /
|
|
1007
|
+
* outlet. Exports ask this, never the role string.
|
|
1008
|
+
*/
|
|
1009
|
+
function isOutlet(type, role) {
|
|
1010
|
+
return type === DeviceType.Switch && role === DeviceRole.Outlet;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* A plain fan behind a switch (a `switch` with role `switch-fan`): exported as
|
|
1014
|
+
* a fan with the switch's on/off only — no speed it does not have.
|
|
1015
|
+
*/
|
|
1016
|
+
function isSwitchFan(type, role) {
|
|
1017
|
+
return type === DeviceType.Switch && role === DeviceRole.SwitchFan;
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* A plug-in heater behind a switch (a `switch` with role `switch-heater`): it
|
|
1021
|
+
* has power only, no setpoint and no room temperature, so an export never
|
|
1022
|
+
* presents it as a thermostat.
|
|
1023
|
+
*/
|
|
1024
|
+
function isSwitchHeater(type, role) {
|
|
1025
|
+
return type === DeviceType.Switch && role === DeviceRole.SwitchHeater;
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* Is a capability offered on a device of this type and role?
|
|
1029
|
+
*
|
|
1030
|
+
* Fails open where the old type-only gate did: no `deviceTypes` (or an empty
|
|
1031
|
+
* list) applies to every device, and an unknown type never filters (a failed
|
|
1032
|
+
* meta read must not destroy work, D49). A type the cap's `deviceRoles` names
|
|
1033
|
+
* is offered only to the roles listed there; an unknown role is NOT one of
|
|
1034
|
+
* them, so a `switch` whose role could not be read is not a heater.
|
|
1035
|
+
*/
|
|
1036
|
+
function capAppliesToDeviceKind(gate, deviceType, role) {
|
|
1037
|
+
if (deviceType === void 0) return true;
|
|
1038
|
+
const types = gate?.deviceTypes;
|
|
1039
|
+
if (!types || types.length === 0) return true;
|
|
1040
|
+
const type = types.find((candidate) => candidate === deviceType);
|
|
1041
|
+
if (type === void 0) return false;
|
|
1042
|
+
const roles = gate?.deviceRoles?.[type];
|
|
1043
|
+
if (roles === void 0) return true;
|
|
1044
|
+
return role !== null && role !== void 0 && roles.some((candidate) => candidate === role);
|
|
1045
|
+
}
|
|
1046
|
+
//#endregion
|
|
937
1047
|
//#region src/catalogs/sensor-active-state.ts
|
|
938
1048
|
/**
|
|
939
1049
|
* THE table "which boolean of this device type counts as HIGH", and the
|
|
@@ -3310,6 +3420,41 @@ var CompositionNewTargetSchema = z.object({
|
|
|
3310
3420
|
type: z.enum(DeviceType),
|
|
3311
3421
|
role: z.enum(DeviceRole).optional()
|
|
3312
3422
|
});
|
|
3423
|
+
/**
|
|
3424
|
+
* A STORED block, read back: the `new` target of its composition may name a
|
|
3425
|
+
* device type D1033 retired (`thermostat`). {@link CompositionNewTargetSchema}
|
|
3426
|
+
* stays a strict enum on the wire, so the store rewrites the retired name to
|
|
3427
|
+
* its canonical type (`source.composition.target.type`) before it parses the
|
|
3428
|
+
* row. Anything else is returned untouched, for the schema to judge.
|
|
3429
|
+
*/
|
|
3430
|
+
function canonicalStoredBlockTarget(block) {
|
|
3431
|
+
if (!isPlainObject(block)) return block;
|
|
3432
|
+
const source = Reflect.get(block, "source");
|
|
3433
|
+
if (!isPlainObject(source)) return block;
|
|
3434
|
+
const composition = Reflect.get(source, "composition");
|
|
3435
|
+
if (!isPlainObject(composition)) return block;
|
|
3436
|
+
const target = Reflect.get(composition, "target");
|
|
3437
|
+
if (!isPlainObject(target)) return block;
|
|
3438
|
+
const type = Reflect.get(target, "type");
|
|
3439
|
+
if (typeof type !== "string") return block;
|
|
3440
|
+
const canonical = {
|
|
3441
|
+
...target,
|
|
3442
|
+
type: canonicalStoredDeviceType(type)
|
|
3443
|
+
};
|
|
3444
|
+
return {
|
|
3445
|
+
...block,
|
|
3446
|
+
source: {
|
|
3447
|
+
...source,
|
|
3448
|
+
composition: {
|
|
3449
|
+
...composition,
|
|
3450
|
+
target: canonical
|
|
3451
|
+
}
|
|
3452
|
+
}
|
|
3453
|
+
};
|
|
3454
|
+
}
|
|
3455
|
+
function isPlainObject(value) {
|
|
3456
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
3457
|
+
}
|
|
3313
3458
|
/** Customize an EXISTING device: each feature adds a capability or replaces fields of a native one (D663). */
|
|
3314
3459
|
var CompositionExistingTargetSchema = z.object({
|
|
3315
3460
|
kind: z.literal("existing"),
|
|
@@ -3409,4 +3554,4 @@ function implementedMethodsOf(methodNames, provider) {
|
|
|
3409
3554
|
return methodNames.filter((name) => typeof Reflect.get(provider, name) === "function");
|
|
3410
3555
|
}
|
|
3411
3556
|
//#endregion
|
|
3412
|
-
export {
|
|
3557
|
+
export { EXPRESSION_OUTPUTS as $, buildAudioArgs as $n, createExpressionScope as $t, MAX_COMPOSITION_FIELDS_PER_FEATURE as A, sliceActiveValue as An, integralCadenceMs as At, featureFieldEntries as B, isSwitchHeater as Bn, STATISTIC_STATS as Bt, CompositionPassthroughFeatureSchema as C, SOURCE_CAPS as Cn, MINUTE_MS as Ct, FORWARD_INPUT_KEY as D, evaluateSensorEdge as Dn, RollingWindowSchema as Dt, CompositionTargetSchema as E, SOURCE_DEVICE_TYPES as En, ROLLING_SPANS as Et, compositionFeatureEnabled as F, capAppliesToDeviceKind as Fn, planResetTier as Ft, AGGREGATE_REDUCERS as G, FFMPEG_RELEASE as Gn, wattMillisecondsToKwh as Gt, fieldReads as H, FFMPEG_PATH_ENV as Hn, evaluateStatistic as Ht, compositionItemFieldPath as I, climateRoleOf as In, planStatisticTier as It, AggregateReducerSchema as J, canonicalHash as Jn, createStatefulExpressionMemory as Jt, ARITHMETIC_OPS as K, getFfmpegArtifact as Kn, EXPRESSION_INJECTED_NOW as Kt, compositionReadKey as L, isAirConditioner as Ln, rollingDurationMs as Lt, canonicalStoredBlockTarget as M, CLIMATE_ROLES as Mn, nextLocalMidnight as Mt, composedDeviceRef as N, StoredDeviceTypeSchema as Nn, openReset as Nt, MAX_COMPOSITION_CODE_LENGTH as O, evaluateSensorLevelEdge as On, StatisticWindowSchema as Ot, composedDeviceStableId as P, canonicalStoredDeviceType as Pn, openStatistic as Pt, DerivativeHelperSpecSchema as Q, audioPlanFromEncodeProfile as Qn, validateExpressionSource as Qt, compositionSliceKey as R, isOutlet as Rn, statisticCadenceMs as Rt, CompositionNewTargetSchema as S, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as Sn, HOUR_MS as St, CompositionSeriesSourceSchema as T, SOURCE_CAP_CHANGED_AT_FIELD as Tn, RESET_PERIODS as Tt, isForwardInputRef as U, chooseFfmpegBinary as Un, integrateReading as Ut, featureSources as V, isSwitchLight as Vn, evaluateDerivative as Vt, ACTIVE_CRITERIA as W, ffmpegBinaryName as Wn, KWH_PER_WATT_MS as Wt, BINARY_AGGREGATES as X, AUDIO_PRESETS as Xn, evaluateStatefulExpressionCall as Xt, ArithmeticHelperSpecSchema as Y, Fmp4BoxSplitter as Yn, evaluateExpressionSource as Yt, DERIVATIVE_UNITS as Z, RESTREAM_INPUT_PROBE as Zn, toExpressionValue as Zt, CompositionForwardArgSchema as _, evaluateDwell as _n, DAY_MS as _t, CUSTOMIZATION_BLOCK_NAME_PREFIX as a, EXPRESSION_COMPILE_CACHE_CAPACITY as an, logBannerArgs as ar, HelperSpecSchema as at, CompositionItemEntrySchema as b, ExpressionEvalError as bn, HISTORY_SLOW_MS as bt, CompositionCodeSourceSchema as c, MAX_EXPRESSION_BINDINGS as cn, MAX_HELPER_MEMBERS as ct, CompositionExpressionSourceSchema as d, MAX_EXPRESSION_SOURCE_LENGTH as dn, ThresholdHelperSpecSchema as dt, evaluateAst as en, buildFfmpegArgs as er, ExpressionHelperSpecSchema as et, CompositionExtensionCommandSchema as f, RESERVED_BINDING_NAMES as fn, helperMembers as ft, CompositionFieldsFeatureSchema as g, evaluateCount as gn, CalendarWindowSchema as gt, CompositionFieldSourceSchema as h, disarmRoseMemory as hn, CALENDAR_PERIODS as ht, COMPOSITION_ITEM_KEY_RE as i, tokenize as in, isSoftwareDecode as ir, HelperMemberSchema as it, MAX_COMPOSITION_ITEMS as j, sliceChangedAt as jn, maxDurationMs as jt, MAX_COMPOSITION_FEATURES as k, isSourceCap as kn, historyRetentionFromSettings as kt, CompositionCommandTargetSchema as l, MAX_EXPRESSION_CALL_ARGS as ln, NUMERIC_AGGREGATES as lt, CompositionFieldReadSchema as m, EXPRESSION_BUILTIN_NAMES as mn, CompositionSourceRefSchema as mt, COMPOSER_ADDON_ID as n, compileExpressionSafe as nn, buildVideoArgs as nr, GroupHelperSpecSchema as nt, CompositionAggregateSourceSchema as o, EXPRESSION_IDENTIFIER_RE as on, pickVideoEncoder as or, INTEGRAL_OUTPUTS as ot, CompositionFeatureSchema as p, EXPRESSION_BUILTINS as pn, isHistoryHelper as pt, ActiveCriterionSchema as q, getFfmpegDownloadUrl as qn, cloneStatefulExpressionMemory as qt, COMPOSITION_ITEM_ARRAY_PATH as r, parseExpression as rn, invocationFromEncodeProfile as rr, GroupTemplateIdSchema as rt, CompositionBindingSchema as s, MAX_EXPRESSION_AST_NODES as sn, resolveStreamMaps as sr, IntegralHelperSpecSchema as st, implementedMethodsOf as t, compileExpression as tn, buildInputArgs as tr, GROUP_TEMPLATE_IDS as tt, CompositionExistingTargetSchema as u, MAX_EXPRESSION_EVAL_STEPS as un, StatisticHelperSpecSchema as ut, CompositionForwardCommandSchema as v, evaluateRose as vn, DEFAULT_HISTORY_RETENTION as vt, CompositionSchema as w, SOURCE_CAP_ACTIVE_FIELD as wn, MIN_CUSTOM_MINUTES as wt, CompositionLiteralBindingSchema as x, ExpressionParseError as xn, HISTORY_TIERS as xt, CompositionFromSourceSchema as y, isStatefulBuiltin as yn, HISTORY_FAST_MS as yt, compositionSourceKey as z, isSwitchFan as zn, SERIES_KINDS as zt };
|