@camstack/addon-provider-homeassistant 1.2.653 → 1.2.654
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 +7 -0
- package/dist/addon.js +669 -495
- package/dist/addon.mjs +206 -32
- package/dist/ha-export/ha-export.addon.js +382 -130
- package/dist/ha-export/ha-export.addon.mjs +336 -84
- package/dist/{ha-broker-source-DnSL-mbs.js → ha-instance-settings-Bn_Trz6p.js} +464 -218
- package/dist/{ha-broker-source-CKdH9XHn.mjs → ha-instance-settings-g5pwb3Fi.mjs} +446 -218
- package/package.json +2 -2
|
@@ -785,7 +785,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
785
785
|
return EventCategory;
|
|
786
786
|
}({});
|
|
787
787
|
//#endregion
|
|
788
|
-
//#region ../types/dist/device-type-
|
|
788
|
+
//#region ../types/dist/device-type-D1fH5kaC.mjs
|
|
789
789
|
/**
|
|
790
790
|
import { errMsg } from '@camstack/types'
|
|
791
791
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -1016,6 +1016,12 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
|
1016
1016
|
DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
|
|
1017
1017
|
/** Media player exposes stop distinct from pause. */
|
|
1018
1018
|
DeviceFeature["MediaPlayerStop"] = "media-player-stop";
|
|
1019
|
+
/** Media player exposes volume up / down in steps (an infrared TV has no level). */
|
|
1020
|
+
DeviceFeature["MediaPlayerVolumeStep"] = "media-player-volume-step";
|
|
1021
|
+
/** Media player exposes channel up / down in steps. */
|
|
1022
|
+
DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
|
|
1023
|
+
/** Media player exposes power on / off. */
|
|
1024
|
+
DeviceFeature["MediaPlayerPower"] = "media-player-power";
|
|
1019
1025
|
/** Alarm panel requires a PIN code on arm/disarm. */
|
|
1020
1026
|
DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
|
|
1021
1027
|
/** Presence device carries GPS coordinates (lat/lng/accuracy) in
|
|
@@ -5975,7 +5981,7 @@ var ZodIssueCode = {
|
|
|
5975
5981
|
var ZodFirstPartyTypeKind;
|
|
5976
5982
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5977
5983
|
//#endregion
|
|
5978
|
-
//#region ../types/dist/sleep-
|
|
5984
|
+
//#region ../types/dist/sleep-BKClVk0K.mjs
|
|
5979
5985
|
/**
|
|
5980
5986
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5981
5987
|
* window to float samples (D455).
|
|
@@ -11781,7 +11787,7 @@ object({
|
|
|
11781
11787
|
params: record(string(), union([string(), number()])).optional()
|
|
11782
11788
|
});
|
|
11783
11789
|
//#endregion
|
|
11784
|
-
//#region ../types/dist/composition-
|
|
11790
|
+
//#region ../types/dist/composition-BodkvOV0.mjs
|
|
11785
11791
|
/**
|
|
11786
11792
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
11787
11793
|
*
|
|
@@ -12918,7 +12924,14 @@ var CompositionForwardCommandSchema = object({
|
|
|
12918
12924
|
method: string().min(1),
|
|
12919
12925
|
args: record(string().min(1), CompositionForwardArgSchema).optional()
|
|
12920
12926
|
});
|
|
12921
|
-
var CompositionCommandTargetSchema = discriminatedUnion("kind", [
|
|
12927
|
+
var CompositionCommandTargetSchema = discriminatedUnion("kind", [
|
|
12928
|
+
CompositionForwardCommandSchema,
|
|
12929
|
+
CompositionCodeSourceSchema,
|
|
12930
|
+
object({
|
|
12931
|
+
kind: literal("extension"),
|
|
12932
|
+
target: literal("remote")
|
|
12933
|
+
})
|
|
12934
|
+
]);
|
|
12922
12935
|
/** An item key inside an item-array cap (`consumables.items[<key>]`). */
|
|
12923
12936
|
var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
|
|
12924
12937
|
/**
|
|
@@ -19579,6 +19592,48 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
19579
19592
|
scope: "device",
|
|
19580
19593
|
noun: t("Media player", "Lettore multimediale"),
|
|
19581
19594
|
actions: [
|
|
19595
|
+
{
|
|
19596
|
+
id: "media.turnOn",
|
|
19597
|
+
method: "turnOn",
|
|
19598
|
+
label: t("Turn on", "Accendi"),
|
|
19599
|
+
phrase: t("Turn on {device}", "Accendi {device}"),
|
|
19600
|
+
icon: "power"
|
|
19601
|
+
},
|
|
19602
|
+
{
|
|
19603
|
+
id: "media.turnOff",
|
|
19604
|
+
method: "turnOff",
|
|
19605
|
+
label: t("Turn off", "Spegni"),
|
|
19606
|
+
phrase: t("Turn off {device}", "Spegni {device}"),
|
|
19607
|
+
icon: "power"
|
|
19608
|
+
},
|
|
19609
|
+
{
|
|
19610
|
+
id: "media.volumeUp",
|
|
19611
|
+
method: "volumeUp",
|
|
19612
|
+
label: t("Volume up", "Alza il volume"),
|
|
19613
|
+
phrase: t("Raise the volume of {device}", "Alza il volume di {device}"),
|
|
19614
|
+
icon: "volume-2"
|
|
19615
|
+
},
|
|
19616
|
+
{
|
|
19617
|
+
id: "media.volumeDown",
|
|
19618
|
+
method: "volumeDown",
|
|
19619
|
+
label: t("Volume down", "Abbassa il volume"),
|
|
19620
|
+
phrase: t("Lower the volume of {device}", "Abbassa il volume di {device}"),
|
|
19621
|
+
icon: "volume-2"
|
|
19622
|
+
},
|
|
19623
|
+
{
|
|
19624
|
+
id: "media.channelUp",
|
|
19625
|
+
method: "channelUp",
|
|
19626
|
+
label: t("Channel up", "Canale successivo"),
|
|
19627
|
+
phrase: t("Go to the next channel on {device}", "Passa al canale successivo su {device}"),
|
|
19628
|
+
icon: "skip-forward"
|
|
19629
|
+
},
|
|
19630
|
+
{
|
|
19631
|
+
id: "media.channelDown",
|
|
19632
|
+
method: "channelDown",
|
|
19633
|
+
label: t("Channel down", "Canale precedente"),
|
|
19634
|
+
phrase: t("Go to the previous channel on {device}", "Torna al canale precedente su {device}"),
|
|
19635
|
+
icon: "skip-back"
|
|
19636
|
+
},
|
|
19582
19637
|
{
|
|
19583
19638
|
id: "media.play",
|
|
19584
19639
|
method: "play",
|
|
@@ -49548,6 +49603,244 @@ var controlCapability = {
|
|
|
49548
49603
|
*/
|
|
49549
49604
|
history: "none"
|
|
49550
49605
|
};
|
|
49606
|
+
/**
|
|
49607
|
+
* Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
|
|
49608
|
+
* Apple TV, Spotify, Roku, generic OTT receivers, …) on
|
|
49609
|
+
* `DeviceType.MediaPlayer`. Disjoint from the camera streaming
|
|
49610
|
+
* surface — those use `DeviceType.Camera` + the broker pipeline.
|
|
49611
|
+
*
|
|
49612
|
+
* The cap declares a wide method surface; not every backend supports
|
|
49613
|
+
* every method. Drivers signal sub-capability via the
|
|
49614
|
+
* `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
|
|
49615
|
+
* corresponding method) so the UI gates buttons without a slice
|
|
49616
|
+
* fetch — same pattern as `PanTiltZoom` for cameras.
|
|
49617
|
+
*/
|
|
49618
|
+
var MediaPlayerStateSchema = _enum([
|
|
49619
|
+
"off",
|
|
49620
|
+
"on",
|
|
49621
|
+
"idle",
|
|
49622
|
+
"playing",
|
|
49623
|
+
"paused",
|
|
49624
|
+
"buffering",
|
|
49625
|
+
"standby"
|
|
49626
|
+
]);
|
|
49627
|
+
var MediaPlayerRepeatSchema = _enum([
|
|
49628
|
+
"off",
|
|
49629
|
+
"all",
|
|
49630
|
+
"one"
|
|
49631
|
+
]);
|
|
49632
|
+
var MediaInfoSchema = object({
|
|
49633
|
+
/** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
|
|
49634
|
+
* `podcast`, …). */
|
|
49635
|
+
type: string(),
|
|
49636
|
+
/** Human-readable title. */
|
|
49637
|
+
title: string(),
|
|
49638
|
+
/** Optional artist / channel / station label. */
|
|
49639
|
+
artist: string().optional(),
|
|
49640
|
+
/** Optional album / season / show name. */
|
|
49641
|
+
album: string().optional(),
|
|
49642
|
+
/** Optional cover-art / thumbnail URL. */
|
|
49643
|
+
imageUrl: string().optional()
|
|
49644
|
+
});
|
|
49645
|
+
/**
|
|
49646
|
+
* Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
|
|
49647
|
+
* the device said so. `assumed`: the driver has no feedback (infrared) and
|
|
49648
|
+
* tracks what it last SENT; it moves only after a send was accepted, and a
|
|
49649
|
+
* human at the real remote makes it wrong. A UI shows an assumed value as a
|
|
49650
|
+
* guess, never as a reading.
|
|
49651
|
+
*/
|
|
49652
|
+
var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
|
|
49653
|
+
/** The fields of a media-player status a driver can only guess. */
|
|
49654
|
+
var MediaPlayerAssumedFieldSchema = _enum([
|
|
49655
|
+
"state",
|
|
49656
|
+
"volumeLevel",
|
|
49657
|
+
"isMuted",
|
|
49658
|
+
"source"
|
|
49659
|
+
]);
|
|
49660
|
+
var MediaPlayerStatusSchema = object({
|
|
49661
|
+
/** Playback lifecycle state. */
|
|
49662
|
+
state: MediaPlayerStateSchema,
|
|
49663
|
+
/**
|
|
49664
|
+
* Whether the state fields are readings or the driver's own bookkeeping.
|
|
49665
|
+
* A slice written before this field existed parses as `reported`.
|
|
49666
|
+
*/
|
|
49667
|
+
stateSource: MediaPlayerStateSourceSchema.default("reported"),
|
|
49668
|
+
/**
|
|
49669
|
+
* Which fields are the driver's own guess. `stateSource` is `assumed` when
|
|
49670
|
+
* this is not empty; a field not listed here is a reading even then (power
|
|
49671
|
+
* from a running-state source, mute guessed from the last send).
|
|
49672
|
+
*/
|
|
49673
|
+
assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
|
|
49674
|
+
/** Volume as 0..100 inclusive. Null when the device has no volume
|
|
49675
|
+
* surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
|
|
49676
|
+
volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
49677
|
+
/** Mute toggle distinct from volume=0. Null when no mute surface.
|
|
49678
|
+
* Pair with `DeviceFeature.MediaPlayerMute`. */
|
|
49679
|
+
isMuted: boolean().nullable(),
|
|
49680
|
+
/** Active source / input. Empty when no source surface. */
|
|
49681
|
+
source: string(),
|
|
49682
|
+
/** Selectable sources. Empty when no source surface.
|
|
49683
|
+
* Pair with `DeviceFeature.MediaPlayerSelectSource`. */
|
|
49684
|
+
availableSources: array(string()),
|
|
49685
|
+
/** Currently-playing media info. Null when nothing is playing. */
|
|
49686
|
+
currentMedia: MediaInfoSchema.nullable(),
|
|
49687
|
+
/** Current playback position in ms. Null when not seekable or
|
|
49688
|
+
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
49689
|
+
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
49690
|
+
/** Total duration of the current media in ms. Null when unknown
|
|
49691
|
+
* (live stream) or nothing is playing. */
|
|
49692
|
+
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
49693
|
+
/** Shuffle toggle. Null when no shuffle surface.
|
|
49694
|
+
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
49695
|
+
shuffle: boolean().nullable(),
|
|
49696
|
+
/** Repeat mode. Null when no repeat surface.
|
|
49697
|
+
* Pair with `DeviceFeature.MediaPlayerRepeat`. */
|
|
49698
|
+
repeat: MediaPlayerRepeatSchema.nullable(),
|
|
49699
|
+
/** Ms epoch when the slice was last updated. */
|
|
49700
|
+
lastChangedAt: number()
|
|
49701
|
+
});
|
|
49702
|
+
var stepInput = object({
|
|
49703
|
+
deviceId: number().int().nonnegative(),
|
|
49704
|
+
/** How many presses: the caller's count (Alexa `volumeSteps`, `channelCount`). */
|
|
49705
|
+
steps: number().int().min(1).max(50).default(1)
|
|
49706
|
+
});
|
|
49707
|
+
var deviceOnly = object({ deviceId: number().int().nonnegative() });
|
|
49708
|
+
var mediaPlayerCapability = {
|
|
49709
|
+
name: "media-player",
|
|
49710
|
+
scope: "device",
|
|
49711
|
+
deviceNative: true,
|
|
49712
|
+
mode: "singleton",
|
|
49713
|
+
deviceTypes: [DeviceType.MediaPlayer],
|
|
49714
|
+
methods: {
|
|
49715
|
+
turnOn: method(deviceOnly, _void(), {
|
|
49716
|
+
kind: "mutation",
|
|
49717
|
+
auth: "protected"
|
|
49718
|
+
}),
|
|
49719
|
+
turnOff: method(deviceOnly, _void(), {
|
|
49720
|
+
kind: "mutation",
|
|
49721
|
+
auth: "protected"
|
|
49722
|
+
}),
|
|
49723
|
+
volumeUp: method(stepInput, _void(), {
|
|
49724
|
+
kind: "mutation",
|
|
49725
|
+
auth: "protected"
|
|
49726
|
+
}),
|
|
49727
|
+
volumeDown: method(stepInput, _void(), {
|
|
49728
|
+
kind: "mutation",
|
|
49729
|
+
auth: "protected"
|
|
49730
|
+
}),
|
|
49731
|
+
channelUp: method(stepInput, _void(), {
|
|
49732
|
+
kind: "mutation",
|
|
49733
|
+
auth: "protected"
|
|
49734
|
+
}),
|
|
49735
|
+
channelDown: method(stepInput, _void(), {
|
|
49736
|
+
kind: "mutation",
|
|
49737
|
+
auth: "protected"
|
|
49738
|
+
}),
|
|
49739
|
+
play: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
49740
|
+
kind: "mutation",
|
|
49741
|
+
auth: "protected"
|
|
49742
|
+
}),
|
|
49743
|
+
pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
49744
|
+
kind: "mutation",
|
|
49745
|
+
auth: "protected"
|
|
49746
|
+
}),
|
|
49747
|
+
stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
49748
|
+
kind: "mutation",
|
|
49749
|
+
auth: "protected"
|
|
49750
|
+
}),
|
|
49751
|
+
next: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
49752
|
+
kind: "mutation",
|
|
49753
|
+
auth: "protected"
|
|
49754
|
+
}),
|
|
49755
|
+
previous: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
49756
|
+
kind: "mutation",
|
|
49757
|
+
auth: "protected"
|
|
49758
|
+
}),
|
|
49759
|
+
seek: method(object({
|
|
49760
|
+
deviceId: number().int().nonnegative(),
|
|
49761
|
+
position: number().int().nonnegative()
|
|
49762
|
+
}), _void(), {
|
|
49763
|
+
kind: "mutation",
|
|
49764
|
+
auth: "protected"
|
|
49765
|
+
}),
|
|
49766
|
+
setVolume: method(object({
|
|
49767
|
+
deviceId: number().int().nonnegative(),
|
|
49768
|
+
volumeLevel: number().min(0).max(100)
|
|
49769
|
+
}), _void(), {
|
|
49770
|
+
kind: "mutation",
|
|
49771
|
+
auth: "protected"
|
|
49772
|
+
}),
|
|
49773
|
+
setMute: method(object({
|
|
49774
|
+
deviceId: number().int().nonnegative(),
|
|
49775
|
+
muted: boolean()
|
|
49776
|
+
}), _void(), {
|
|
49777
|
+
kind: "mutation",
|
|
49778
|
+
auth: "protected"
|
|
49779
|
+
}),
|
|
49780
|
+
setShuffle: method(object({
|
|
49781
|
+
deviceId: number().int().nonnegative(),
|
|
49782
|
+
shuffle: boolean()
|
|
49783
|
+
}), _void(), {
|
|
49784
|
+
kind: "mutation",
|
|
49785
|
+
auth: "protected"
|
|
49786
|
+
}),
|
|
49787
|
+
setRepeat: method(object({
|
|
49788
|
+
deviceId: number().int().nonnegative(),
|
|
49789
|
+
repeat: MediaPlayerRepeatSchema
|
|
49790
|
+
}), _void(), {
|
|
49791
|
+
kind: "mutation",
|
|
49792
|
+
auth: "protected"
|
|
49793
|
+
}),
|
|
49794
|
+
selectSource: method(object({
|
|
49795
|
+
deviceId: number().int().nonnegative(),
|
|
49796
|
+
source: string().min(1)
|
|
49797
|
+
}), _void(), {
|
|
49798
|
+
kind: "mutation",
|
|
49799
|
+
auth: "protected"
|
|
49800
|
+
}),
|
|
49801
|
+
playMedia: method(object({
|
|
49802
|
+
deviceId: number().int().nonnegative(),
|
|
49803
|
+
/** Media identifier / URL. */
|
|
49804
|
+
mediaId: string().min(1),
|
|
49805
|
+
/** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
|
|
49806
|
+
* passes it through to the upstream service. */
|
|
49807
|
+
mediaType: string().min(1)
|
|
49808
|
+
}), _void(), {
|
|
49809
|
+
kind: "mutation",
|
|
49810
|
+
auth: "protected"
|
|
49811
|
+
})
|
|
49812
|
+
},
|
|
49813
|
+
status: {
|
|
49814
|
+
schema: MediaPlayerStatusSchema,
|
|
49815
|
+
kind: "push"
|
|
49816
|
+
},
|
|
49817
|
+
/**
|
|
49818
|
+
* Runtime-state slice — mirrored by the kernel. UI players read the
|
|
49819
|
+
* full slice for live now-playing, volume, and progress updates
|
|
49820
|
+
* without polling.
|
|
49821
|
+
*/
|
|
49822
|
+
runtimeState: MediaPlayerStatusSchema,
|
|
49823
|
+
/**
|
|
49824
|
+
* Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
|
|
49825
|
+
*
|
|
49826
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
49827
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
49828
|
+
*/
|
|
49829
|
+
durability: "session",
|
|
49830
|
+
/**
|
|
49831
|
+
* History (D850): volume (a level an operator or an automation sets; the
|
|
49832
|
+
* default 10 s floor folds a slider drag into its end value) and mute.
|
|
49833
|
+
* `position` is not recorded: it moves continuously while playing.
|
|
49834
|
+
*/
|
|
49835
|
+
history: { fields: {
|
|
49836
|
+
volumeLevel: {
|
|
49837
|
+
kind: "gauge",
|
|
49838
|
+
unit: "%",
|
|
49839
|
+
deadband: 1
|
|
49840
|
+
},
|
|
49841
|
+
isMuted: { kind: "boolean" }
|
|
49842
|
+
} }
|
|
49843
|
+
};
|
|
49551
49844
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater;
|
|
49552
49845
|
var NUMBER = {
|
|
49553
49846
|
kind: "fixed",
|
|
@@ -58301,214 +58594,6 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
|
|
|
58301
58594
|
]);
|
|
58302
58595
|
method(_void(), array(LoginMethodContributionSchema).readonly());
|
|
58303
58596
|
/**
|
|
58304
|
-
* Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
|
|
58305
|
-
* Apple TV, Spotify, Roku, generic OTT receivers, …) on
|
|
58306
|
-
* `DeviceType.MediaPlayer`. Disjoint from the camera streaming
|
|
58307
|
-
* surface — those use `DeviceType.Camera` + the broker pipeline.
|
|
58308
|
-
*
|
|
58309
|
-
* The cap declares a wide method surface; not every backend supports
|
|
58310
|
-
* every method. Drivers signal sub-capability via the
|
|
58311
|
-
* `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
|
|
58312
|
-
* corresponding method) so the UI gates buttons without a slice
|
|
58313
|
-
* fetch — same pattern as `PanTiltZoom` for cameras.
|
|
58314
|
-
*/
|
|
58315
|
-
var MediaPlayerStateSchema = _enum([
|
|
58316
|
-
"off",
|
|
58317
|
-
"on",
|
|
58318
|
-
"idle",
|
|
58319
|
-
"playing",
|
|
58320
|
-
"paused",
|
|
58321
|
-
"buffering",
|
|
58322
|
-
"standby"
|
|
58323
|
-
]);
|
|
58324
|
-
var MediaPlayerRepeatSchema = _enum([
|
|
58325
|
-
"off",
|
|
58326
|
-
"all",
|
|
58327
|
-
"one"
|
|
58328
|
-
]);
|
|
58329
|
-
var MediaInfoSchema = object({
|
|
58330
|
-
/** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
|
|
58331
|
-
* `podcast`, …). */
|
|
58332
|
-
type: string(),
|
|
58333
|
-
/** Human-readable title. */
|
|
58334
|
-
title: string(),
|
|
58335
|
-
/** Optional artist / channel / station label. */
|
|
58336
|
-
artist: string().optional(),
|
|
58337
|
-
/** Optional album / season / show name. */
|
|
58338
|
-
album: string().optional(),
|
|
58339
|
-
/** Optional cover-art / thumbnail URL. */
|
|
58340
|
-
imageUrl: string().optional()
|
|
58341
|
-
});
|
|
58342
|
-
/**
|
|
58343
|
-
* Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
|
|
58344
|
-
* the device said so. `assumed`: the driver has no feedback (infrared) and
|
|
58345
|
-
* tracks what it last SENT; it moves only after a send was accepted, and a
|
|
58346
|
-
* human at the real remote makes it wrong. A UI shows an assumed value as a
|
|
58347
|
-
* guess, never as a reading.
|
|
58348
|
-
*/
|
|
58349
|
-
var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
|
|
58350
|
-
/** The fields of a media-player status a driver can only guess. */
|
|
58351
|
-
var MediaPlayerAssumedFieldSchema = _enum([
|
|
58352
|
-
"state",
|
|
58353
|
-
"volumeLevel",
|
|
58354
|
-
"isMuted",
|
|
58355
|
-
"source"
|
|
58356
|
-
]);
|
|
58357
|
-
var MediaPlayerStatusSchema = object({
|
|
58358
|
-
/** Playback lifecycle state. */
|
|
58359
|
-
state: MediaPlayerStateSchema,
|
|
58360
|
-
/**
|
|
58361
|
-
* Whether the state fields are readings or the driver's own bookkeeping.
|
|
58362
|
-
* A slice written before this field existed parses as `reported`.
|
|
58363
|
-
*/
|
|
58364
|
-
stateSource: MediaPlayerStateSourceSchema.default("reported"),
|
|
58365
|
-
/**
|
|
58366
|
-
* Which fields are the driver's own guess. `stateSource` is `assumed` when
|
|
58367
|
-
* this is not empty; a field not listed here is a reading even then (power
|
|
58368
|
-
* from a running-state source, mute guessed from the last send).
|
|
58369
|
-
*/
|
|
58370
|
-
assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
|
|
58371
|
-
/** Volume as 0..100 inclusive. Null when the device has no volume
|
|
58372
|
-
* surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
|
|
58373
|
-
volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
58374
|
-
/** Mute toggle distinct from volume=0. Null when no mute surface.
|
|
58375
|
-
* Pair with `DeviceFeature.MediaPlayerMute`. */
|
|
58376
|
-
isMuted: boolean().nullable(),
|
|
58377
|
-
/** Active source / input. Empty when no source surface. */
|
|
58378
|
-
source: string(),
|
|
58379
|
-
/** Selectable sources. Empty when no source surface.
|
|
58380
|
-
* Pair with `DeviceFeature.MediaPlayerSelectSource`. */
|
|
58381
|
-
availableSources: array(string()),
|
|
58382
|
-
/** Currently-playing media info. Null when nothing is playing. */
|
|
58383
|
-
currentMedia: MediaInfoSchema.nullable(),
|
|
58384
|
-
/** Current playback position in ms. Null when not seekable or
|
|
58385
|
-
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
58386
|
-
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
58387
|
-
/** Total duration of the current media in ms. Null when unknown
|
|
58388
|
-
* (live stream) or nothing is playing. */
|
|
58389
|
-
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
58390
|
-
/** Shuffle toggle. Null when no shuffle surface.
|
|
58391
|
-
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
58392
|
-
shuffle: boolean().nullable(),
|
|
58393
|
-
/** Repeat mode. Null when no repeat surface.
|
|
58394
|
-
* Pair with `DeviceFeature.MediaPlayerRepeat`. */
|
|
58395
|
-
repeat: MediaPlayerRepeatSchema.nullable(),
|
|
58396
|
-
/** Ms epoch when the slice was last updated. */
|
|
58397
|
-
lastChangedAt: number()
|
|
58398
|
-
});
|
|
58399
|
-
var mediaPlayerCapability = {
|
|
58400
|
-
name: "media-player",
|
|
58401
|
-
scope: "device",
|
|
58402
|
-
deviceNative: true,
|
|
58403
|
-
mode: "singleton",
|
|
58404
|
-
deviceTypes: [DeviceType.MediaPlayer],
|
|
58405
|
-
methods: {
|
|
58406
|
-
play: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
58407
|
-
kind: "mutation",
|
|
58408
|
-
auth: "protected"
|
|
58409
|
-
}),
|
|
58410
|
-
pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
58411
|
-
kind: "mutation",
|
|
58412
|
-
auth: "protected"
|
|
58413
|
-
}),
|
|
58414
|
-
stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
58415
|
-
kind: "mutation",
|
|
58416
|
-
auth: "protected"
|
|
58417
|
-
}),
|
|
58418
|
-
next: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
58419
|
-
kind: "mutation",
|
|
58420
|
-
auth: "protected"
|
|
58421
|
-
}),
|
|
58422
|
-
previous: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
58423
|
-
kind: "mutation",
|
|
58424
|
-
auth: "protected"
|
|
58425
|
-
}),
|
|
58426
|
-
seek: method(object({
|
|
58427
|
-
deviceId: number().int().nonnegative(),
|
|
58428
|
-
position: number().int().nonnegative()
|
|
58429
|
-
}), _void(), {
|
|
58430
|
-
kind: "mutation",
|
|
58431
|
-
auth: "protected"
|
|
58432
|
-
}),
|
|
58433
|
-
setVolume: method(object({
|
|
58434
|
-
deviceId: number().int().nonnegative(),
|
|
58435
|
-
volumeLevel: number().min(0).max(100)
|
|
58436
|
-
}), _void(), {
|
|
58437
|
-
kind: "mutation",
|
|
58438
|
-
auth: "protected"
|
|
58439
|
-
}),
|
|
58440
|
-
setMute: method(object({
|
|
58441
|
-
deviceId: number().int().nonnegative(),
|
|
58442
|
-
muted: boolean()
|
|
58443
|
-
}), _void(), {
|
|
58444
|
-
kind: "mutation",
|
|
58445
|
-
auth: "protected"
|
|
58446
|
-
}),
|
|
58447
|
-
setShuffle: method(object({
|
|
58448
|
-
deviceId: number().int().nonnegative(),
|
|
58449
|
-
shuffle: boolean()
|
|
58450
|
-
}), _void(), {
|
|
58451
|
-
kind: "mutation",
|
|
58452
|
-
auth: "protected"
|
|
58453
|
-
}),
|
|
58454
|
-
setRepeat: method(object({
|
|
58455
|
-
deviceId: number().int().nonnegative(),
|
|
58456
|
-
repeat: MediaPlayerRepeatSchema
|
|
58457
|
-
}), _void(), {
|
|
58458
|
-
kind: "mutation",
|
|
58459
|
-
auth: "protected"
|
|
58460
|
-
}),
|
|
58461
|
-
selectSource: method(object({
|
|
58462
|
-
deviceId: number().int().nonnegative(),
|
|
58463
|
-
source: string().min(1)
|
|
58464
|
-
}), _void(), {
|
|
58465
|
-
kind: "mutation",
|
|
58466
|
-
auth: "protected"
|
|
58467
|
-
}),
|
|
58468
|
-
playMedia: method(object({
|
|
58469
|
-
deviceId: number().int().nonnegative(),
|
|
58470
|
-
/** Media identifier / URL. */
|
|
58471
|
-
mediaId: string().min(1),
|
|
58472
|
-
/** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
|
|
58473
|
-
* passes it through to the upstream service. */
|
|
58474
|
-
mediaType: string().min(1)
|
|
58475
|
-
}), _void(), {
|
|
58476
|
-
kind: "mutation",
|
|
58477
|
-
auth: "protected"
|
|
58478
|
-
})
|
|
58479
|
-
},
|
|
58480
|
-
status: {
|
|
58481
|
-
schema: MediaPlayerStatusSchema,
|
|
58482
|
-
kind: "push"
|
|
58483
|
-
},
|
|
58484
|
-
/**
|
|
58485
|
-
* Runtime-state slice — mirrored by the kernel. UI players read the
|
|
58486
|
-
* full slice for live now-playing, volume, and progress updates
|
|
58487
|
-
* without polling.
|
|
58488
|
-
*/
|
|
58489
|
-
runtimeState: MediaPlayerStatusSchema,
|
|
58490
|
-
/**
|
|
58491
|
-
* Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
|
|
58492
|
-
*
|
|
58493
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
58494
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
58495
|
-
*/
|
|
58496
|
-
durability: "session",
|
|
58497
|
-
/**
|
|
58498
|
-
* History (D850): volume (a level an operator or an automation sets; the
|
|
58499
|
-
* default 10 s floor folds a slider drag into its end value) and mute.
|
|
58500
|
-
* `position` is not recorded: it moves continuously while playing.
|
|
58501
|
-
*/
|
|
58502
|
-
history: { fields: {
|
|
58503
|
-
volumeLevel: {
|
|
58504
|
-
kind: "gauge",
|
|
58505
|
-
unit: "%",
|
|
58506
|
-
deadband: 1
|
|
58507
|
-
},
|
|
58508
|
-
isMuted: { kind: "boolean" }
|
|
58509
|
-
} }
|
|
58510
|
-
};
|
|
58511
|
-
/**
|
|
58512
58597
|
* mesh-network — collection cap for mesh-VPN providers.
|
|
58513
58598
|
*
|
|
58514
58599
|
* Different shape from `network-access` (public tunnels):
|
|
@@ -74309,7 +74394,13 @@ var RemoteMediaCommandSchema = _enum([
|
|
|
74309
74394
|
"next",
|
|
74310
74395
|
"previous",
|
|
74311
74396
|
"setMute",
|
|
74312
|
-
"selectSource"
|
|
74397
|
+
"selectSource",
|
|
74398
|
+
"turnOn",
|
|
74399
|
+
"turnOff",
|
|
74400
|
+
"volumeUp",
|
|
74401
|
+
"volumeDown",
|
|
74402
|
+
"channelUp",
|
|
74403
|
+
"channelDown"
|
|
74313
74404
|
]);
|
|
74314
74405
|
/** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
|
|
74315
74406
|
var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
|
|
@@ -74330,7 +74421,7 @@ method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.e
|
|
|
74330
74421
|
}), RemoteSendResultSchema, {
|
|
74331
74422
|
kind: "mutation",
|
|
74332
74423
|
auth: "protected"
|
|
74333
|
-
}), method(deviceInput.extend({
|
|
74424
|
+
}), method(deviceInput, MediaPlayerStatusSchema.nullable(), { auth: "protected" }), method(deviceInput.extend({
|
|
74334
74425
|
command: RemoteMediaCommandSchema,
|
|
74335
74426
|
muted: boolean().optional(),
|
|
74336
74427
|
source: string().optional(),
|
|
@@ -76584,7 +76675,11 @@ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
|
|
|
76584
76675
|
* `getSettingsUISchema()` surface.
|
|
76585
76676
|
*/
|
|
76586
76677
|
var SwitchStatusSchema = object({
|
|
76587
|
-
|
|
76678
|
+
/**
|
|
76679
|
+
* `null` = the device has never reported its state (a measurement that
|
|
76680
|
+
* has not happened is unknown, never `false`).
|
|
76681
|
+
*/
|
|
76682
|
+
on: boolean().nullable().meta({ label: "On" }),
|
|
76588
76683
|
/** Ms epoch of the last state change. Useful for UI "X minutes ago". */
|
|
76589
76684
|
lastChangedAt: number()
|
|
76590
76685
|
});
|
|
@@ -76609,7 +76704,7 @@ var switchCapability = {
|
|
|
76609
76704
|
}) },
|
|
76610
76705
|
events: { onStateChanged: { data: object({
|
|
76611
76706
|
deviceId: number(),
|
|
76612
|
-
on: boolean(),
|
|
76707
|
+
on: boolean().nullable(),
|
|
76613
76708
|
lastChangedAt: number()
|
|
76614
76709
|
}) } },
|
|
76615
76710
|
status: {
|
|
@@ -80292,6 +80387,7 @@ function buildDescriptor(capName, kind) {
|
|
|
80292
80387
|
* contributes one entry per bound cap present in this map.
|
|
80293
80388
|
*/
|
|
80294
80389
|
var EVENT_KIND_BY_CAP = Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
|
|
80390
|
+
DeviceFeature.MediaPlayerPower, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious;
|
|
80295
80391
|
var btn = (idSuffix, row, col, init) => ({
|
|
80296
80392
|
idSuffix,
|
|
80297
80393
|
row,
|
|
@@ -86507,6 +86603,20 @@ Object.freeze({
|
|
|
86507
86603
|
access: "view",
|
|
86508
86604
|
role: "admin"
|
|
86509
86605
|
},
|
|
86606
|
+
"mediaPlayer.channelDown": {
|
|
86607
|
+
capName: "media-player",
|
|
86608
|
+
capScope: "device",
|
|
86609
|
+
addonId: null,
|
|
86610
|
+
access: "create",
|
|
86611
|
+
role: "viewer"
|
|
86612
|
+
},
|
|
86613
|
+
"mediaPlayer.channelUp": {
|
|
86614
|
+
capName: "media-player",
|
|
86615
|
+
capScope: "device",
|
|
86616
|
+
addonId: null,
|
|
86617
|
+
access: "create",
|
|
86618
|
+
role: "viewer"
|
|
86619
|
+
},
|
|
86510
86620
|
"mediaPlayer.getStatus": {
|
|
86511
86621
|
capName: "media-player",
|
|
86512
86622
|
capScope: "device",
|
|
@@ -86598,6 +86708,34 @@ Object.freeze({
|
|
|
86598
86708
|
access: "create",
|
|
86599
86709
|
role: "viewer"
|
|
86600
86710
|
},
|
|
86711
|
+
"mediaPlayer.turnOff": {
|
|
86712
|
+
capName: "media-player",
|
|
86713
|
+
capScope: "device",
|
|
86714
|
+
addonId: null,
|
|
86715
|
+
access: "create",
|
|
86716
|
+
role: "viewer"
|
|
86717
|
+
},
|
|
86718
|
+
"mediaPlayer.turnOn": {
|
|
86719
|
+
capName: "media-player",
|
|
86720
|
+
capScope: "device",
|
|
86721
|
+
addonId: null,
|
|
86722
|
+
access: "create",
|
|
86723
|
+
role: "viewer"
|
|
86724
|
+
},
|
|
86725
|
+
"mediaPlayer.volumeDown": {
|
|
86726
|
+
capName: "media-player",
|
|
86727
|
+
capScope: "device",
|
|
86728
|
+
addonId: null,
|
|
86729
|
+
access: "create",
|
|
86730
|
+
role: "viewer"
|
|
86731
|
+
},
|
|
86732
|
+
"mediaPlayer.volumeUp": {
|
|
86733
|
+
capName: "media-player",
|
|
86734
|
+
capScope: "device",
|
|
86735
|
+
addonId: null,
|
|
86736
|
+
access: "create",
|
|
86737
|
+
role: "viewer"
|
|
86738
|
+
},
|
|
86601
86739
|
"meshNetwork.getStatus": {
|
|
86602
86740
|
capName: "mesh-network",
|
|
86603
86741
|
capScope: "system",
|
|
@@ -90154,6 +90292,13 @@ Object.freeze({
|
|
|
90154
90292
|
access: "create",
|
|
90155
90293
|
role: "admin"
|
|
90156
90294
|
},
|
|
90295
|
+
"remote.getAssumedStatus": {
|
|
90296
|
+
capName: "remote",
|
|
90297
|
+
capScope: "system",
|
|
90298
|
+
addonId: null,
|
|
90299
|
+
access: "view",
|
|
90300
|
+
role: "admin"
|
|
90301
|
+
},
|
|
90157
90302
|
"remote.getConfig": {
|
|
90158
90303
|
capName: "remote",
|
|
90159
90304
|
capScope: "system",
|
|
@@ -93831,6 +93976,16 @@ Object.freeze({
|
|
|
93831
93976
|
form: "single",
|
|
93832
93977
|
optional: true
|
|
93833
93978
|
}],
|
|
93979
|
+
"mediaPlayer.channelDown": [{
|
|
93980
|
+
name: "deviceId",
|
|
93981
|
+
form: "single",
|
|
93982
|
+
optional: false
|
|
93983
|
+
}],
|
|
93984
|
+
"mediaPlayer.channelUp": [{
|
|
93985
|
+
name: "deviceId",
|
|
93986
|
+
form: "single",
|
|
93987
|
+
optional: false
|
|
93988
|
+
}],
|
|
93834
93989
|
"mediaPlayer.getStatus": [{
|
|
93835
93990
|
name: "deviceId",
|
|
93836
93991
|
form: "single",
|
|
@@ -93896,6 +94051,26 @@ Object.freeze({
|
|
|
93896
94051
|
form: "single",
|
|
93897
94052
|
optional: false
|
|
93898
94053
|
}],
|
|
94054
|
+
"mediaPlayer.turnOff": [{
|
|
94055
|
+
name: "deviceId",
|
|
94056
|
+
form: "single",
|
|
94057
|
+
optional: false
|
|
94058
|
+
}],
|
|
94059
|
+
"mediaPlayer.turnOn": [{
|
|
94060
|
+
name: "deviceId",
|
|
94061
|
+
form: "single",
|
|
94062
|
+
optional: false
|
|
94063
|
+
}],
|
|
94064
|
+
"mediaPlayer.volumeDown": [{
|
|
94065
|
+
name: "deviceId",
|
|
94066
|
+
form: "single",
|
|
94067
|
+
optional: false
|
|
94068
|
+
}],
|
|
94069
|
+
"mediaPlayer.volumeUp": [{
|
|
94070
|
+
name: "deviceId",
|
|
94071
|
+
form: "single",
|
|
94072
|
+
optional: false
|
|
94073
|
+
}],
|
|
93899
94074
|
"meter.getStatus": [{
|
|
93900
94075
|
name: "deviceId",
|
|
93901
94076
|
form: "single",
|
|
@@ -95061,6 +95236,11 @@ Object.freeze({
|
|
|
95061
95236
|
form: "single",
|
|
95062
95237
|
optional: true
|
|
95063
95238
|
}],
|
|
95239
|
+
"remote.getAssumedStatus": [{
|
|
95240
|
+
name: "deviceId",
|
|
95241
|
+
form: "single",
|
|
95242
|
+
optional: false
|
|
95243
|
+
}],
|
|
95064
95244
|
"remote.getConfig": [{
|
|
95065
95245
|
name: "deviceId",
|
|
95066
95246
|
form: "single",
|
|
@@ -97484,7 +97664,7 @@ object({
|
|
|
97484
97664
|
* short-circuits any cap the calling process already provides.
|
|
97485
97665
|
*/
|
|
97486
97666
|
/** The addon that owns the import direction, and every `ha_*` broker. */
|
|
97487
|
-
var HA_PROVIDER_ADDON_ID = "provider-homeassistant";
|
|
97667
|
+
var HA_PROVIDER_ADDON_ID$1 = "provider-homeassistant";
|
|
97488
97668
|
/** The `BrokerInfo.kind` tag the Home Assistant provider stamps. */
|
|
97489
97669
|
var HA_BROKER_KIND = "home-assistant";
|
|
97490
97670
|
/**
|
|
@@ -97498,6 +97678,54 @@ var HA_BROKER_KIND = "home-assistant";
|
|
|
97498
97678
|
async function listHomeAssistantBrokers(query) {
|
|
97499
97679
|
return (await query({})).filter((broker) => broker.kind === HA_BROKER_KIND);
|
|
97500
97680
|
}
|
|
97681
|
+
function haInstanceSettingsPortsOver(api) {
|
|
97682
|
+
const listInstances = async () => {
|
|
97683
|
+
const all = await api.list.query();
|
|
97684
|
+
const rows = [];
|
|
97685
|
+
for (const integration of all) {
|
|
97686
|
+
if (integration.addonId !== "provider-homeassistant") continue;
|
|
97687
|
+
const settings = await api.getSettings.query({ id: integration.id });
|
|
97688
|
+
const brokerId = settings["brokerId"];
|
|
97689
|
+
rows.push({
|
|
97690
|
+
integrationId: integration.id,
|
|
97691
|
+
brokerId: typeof brokerId === "string" && brokerId.length > 0 ? brokerId : null,
|
|
97692
|
+
settings
|
|
97693
|
+
});
|
|
97694
|
+
}
|
|
97695
|
+
return rows;
|
|
97696
|
+
};
|
|
97697
|
+
return {
|
|
97698
|
+
listInstances,
|
|
97699
|
+
patchInstanceSettings: async (integrationId, patch) => {
|
|
97700
|
+
if (!(await api.list.query()).some((i) => i.id === integrationId && i.addonId === "provider-homeassistant")) return false;
|
|
97701
|
+
const stored = await api.getSettings.query({ id: integrationId });
|
|
97702
|
+
await api.setSettings.mutate({
|
|
97703
|
+
id: integrationId,
|
|
97704
|
+
settings: {
|
|
97705
|
+
...stored,
|
|
97706
|
+
...patch
|
|
97707
|
+
},
|
|
97708
|
+
skipRestart: true
|
|
97709
|
+
});
|
|
97710
|
+
return true;
|
|
97711
|
+
}
|
|
97712
|
+
};
|
|
97713
|
+
}
|
|
97714
|
+
/** The brokerId → settings view of the instances: what a reader keeps per broker. */
|
|
97715
|
+
function settingsByBroker(rows) {
|
|
97716
|
+
const out = /* @__PURE__ */ new Map();
|
|
97717
|
+
for (const row of rows) if (row.brokerId !== null) out.set(row.brokerId, row.settings);
|
|
97718
|
+
return out;
|
|
97719
|
+
}
|
|
97720
|
+
/** Read the instances, or report why not and answer nothing (a reader falls back to the legacy key). */
|
|
97721
|
+
async function listInstancesOrNothing(ports, onError) {
|
|
97722
|
+
try {
|
|
97723
|
+
return await ports.listInstances();
|
|
97724
|
+
} catch (err) {
|
|
97725
|
+
onError(errMsg(err));
|
|
97726
|
+
return [];
|
|
97727
|
+
}
|
|
97728
|
+
}
|
|
97501
97729
|
//#endregion
|
|
97502
97730
|
Object.defineProperty(exports, "AlarmArmModeSchema", {
|
|
97503
97731
|
enumerable: true,
|
|
@@ -97604,7 +97832,7 @@ Object.defineProperty(exports, "HA_BROKER_KIND", {
|
|
|
97604
97832
|
Object.defineProperty(exports, "HA_PROVIDER_ADDON_ID", {
|
|
97605
97833
|
enumerable: true,
|
|
97606
97834
|
get: function() {
|
|
97607
|
-
return HA_PROVIDER_ADDON_ID;
|
|
97835
|
+
return HA_PROVIDER_ADDON_ID$1;
|
|
97608
97836
|
}
|
|
97609
97837
|
});
|
|
97610
97838
|
Object.defineProperty(exports, "HvacModeSchema", {
|
|
@@ -97907,6 +98135,12 @@ Object.defineProperty(exports, "gasCapability", {
|
|
|
97907
98135
|
return gasCapability;
|
|
97908
98136
|
}
|
|
97909
98137
|
});
|
|
98138
|
+
Object.defineProperty(exports, "haInstanceSettingsPortsOver", {
|
|
98139
|
+
enumerable: true,
|
|
98140
|
+
get: function() {
|
|
98141
|
+
return haInstanceSettingsPortsOver;
|
|
98142
|
+
}
|
|
98143
|
+
});
|
|
97910
98144
|
Object.defineProperty(exports, "humidifierCapability", {
|
|
97911
98145
|
enumerable: true,
|
|
97912
98146
|
get: function() {
|
|
@@ -97949,6 +98183,12 @@ Object.defineProperty(exports, "listHomeAssistantBrokers", {
|
|
|
97949
98183
|
return listHomeAssistantBrokers;
|
|
97950
98184
|
}
|
|
97951
98185
|
});
|
|
98186
|
+
Object.defineProperty(exports, "listInstancesOrNothing", {
|
|
98187
|
+
enumerable: true,
|
|
98188
|
+
get: function() {
|
|
98189
|
+
return listInstancesOrNothing;
|
|
98190
|
+
}
|
|
98191
|
+
});
|
|
97952
98192
|
Object.defineProperty(exports, "literal", {
|
|
97953
98193
|
enumerable: true,
|
|
97954
98194
|
get: function() {
|
|
@@ -98129,6 +98369,12 @@ Object.defineProperty(exports, "sendToExportedTarget", {
|
|
|
98129
98369
|
return sendToExportedTarget;
|
|
98130
98370
|
}
|
|
98131
98371
|
});
|
|
98372
|
+
Object.defineProperty(exports, "settingsByBroker", {
|
|
98373
|
+
enumerable: true,
|
|
98374
|
+
get: function() {
|
|
98375
|
+
return settingsByBroker;
|
|
98376
|
+
}
|
|
98377
|
+
});
|
|
98132
98378
|
Object.defineProperty(exports, "smokeCapability", {
|
|
98133
98379
|
enumerable: true,
|
|
98134
98380
|
get: function() {
|