@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.
@@ -784,7 +784,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
784
784
  return EventCategory;
785
785
  }({});
786
786
  //#endregion
787
- //#region ../types/dist/device-type-CfHw_quR.mjs
787
+ //#region ../types/dist/device-type-D1fH5kaC.mjs
788
788
  /**
789
789
  import { errMsg } from '@camstack/types'
790
790
  * Extract a human-readable message from an unknown error value.
@@ -1015,6 +1015,12 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1015
1015
  DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
1016
1016
  /** Media player exposes stop distinct from pause. */
1017
1017
  DeviceFeature["MediaPlayerStop"] = "media-player-stop";
1018
+ /** Media player exposes volume up / down in steps (an infrared TV has no level). */
1019
+ DeviceFeature["MediaPlayerVolumeStep"] = "media-player-volume-step";
1020
+ /** Media player exposes channel up / down in steps. */
1021
+ DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
1022
+ /** Media player exposes power on / off. */
1023
+ DeviceFeature["MediaPlayerPower"] = "media-player-power";
1018
1024
  /** Alarm panel requires a PIN code on arm/disarm. */
1019
1025
  DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
1020
1026
  /** Presence device carries GPS coordinates (lat/lng/accuracy) in
@@ -5974,7 +5980,7 @@ var ZodIssueCode = {
5974
5980
  var ZodFirstPartyTypeKind;
5975
5981
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5976
5982
  //#endregion
5977
- //#region ../types/dist/sleep-C6LqREpb.mjs
5983
+ //#region ../types/dist/sleep-BKClVk0K.mjs
5978
5984
  /**
5979
5985
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5980
5986
  * window to float samples (D455).
@@ -11780,7 +11786,7 @@ object({
11780
11786
  params: record(string(), union([string(), number()])).optional()
11781
11787
  });
11782
11788
  //#endregion
11783
- //#region ../types/dist/composition-Dh3RfMx5.mjs
11789
+ //#region ../types/dist/composition-BodkvOV0.mjs
11784
11790
  /**
11785
11791
  * The ffmpeg build every CamStack node downloads, per platform and arch.
11786
11792
  *
@@ -12917,7 +12923,14 @@ var CompositionForwardCommandSchema = object({
12917
12923
  method: string().min(1),
12918
12924
  args: record(string().min(1), CompositionForwardArgSchema).optional()
12919
12925
  });
12920
- var CompositionCommandTargetSchema = discriminatedUnion("kind", [CompositionForwardCommandSchema, CompositionCodeSourceSchema]);
12926
+ var CompositionCommandTargetSchema = discriminatedUnion("kind", [
12927
+ CompositionForwardCommandSchema,
12928
+ CompositionCodeSourceSchema,
12929
+ object({
12930
+ kind: literal("extension"),
12931
+ target: literal("remote")
12932
+ })
12933
+ ]);
12921
12934
  /** An item key inside an item-array cap (`consumables.items[<key>]`). */
12922
12935
  var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
12923
12936
  /**
@@ -19578,6 +19591,48 @@ var APPLIANCE_CAP_VOCABULARY = {
19578
19591
  scope: "device",
19579
19592
  noun: t("Media player", "Lettore multimediale"),
19580
19593
  actions: [
19594
+ {
19595
+ id: "media.turnOn",
19596
+ method: "turnOn",
19597
+ label: t("Turn on", "Accendi"),
19598
+ phrase: t("Turn on {device}", "Accendi {device}"),
19599
+ icon: "power"
19600
+ },
19601
+ {
19602
+ id: "media.turnOff",
19603
+ method: "turnOff",
19604
+ label: t("Turn off", "Spegni"),
19605
+ phrase: t("Turn off {device}", "Spegni {device}"),
19606
+ icon: "power"
19607
+ },
19608
+ {
19609
+ id: "media.volumeUp",
19610
+ method: "volumeUp",
19611
+ label: t("Volume up", "Alza il volume"),
19612
+ phrase: t("Raise the volume of {device}", "Alza il volume di {device}"),
19613
+ icon: "volume-2"
19614
+ },
19615
+ {
19616
+ id: "media.volumeDown",
19617
+ method: "volumeDown",
19618
+ label: t("Volume down", "Abbassa il volume"),
19619
+ phrase: t("Lower the volume of {device}", "Abbassa il volume di {device}"),
19620
+ icon: "volume-2"
19621
+ },
19622
+ {
19623
+ id: "media.channelUp",
19624
+ method: "channelUp",
19625
+ label: t("Channel up", "Canale successivo"),
19626
+ phrase: t("Go to the next channel on {device}", "Passa al canale successivo su {device}"),
19627
+ icon: "skip-forward"
19628
+ },
19629
+ {
19630
+ id: "media.channelDown",
19631
+ method: "channelDown",
19632
+ label: t("Channel down", "Canale precedente"),
19633
+ phrase: t("Go to the previous channel on {device}", "Torna al canale precedente su {device}"),
19634
+ icon: "skip-back"
19635
+ },
19581
19636
  {
19582
19637
  id: "media.play",
19583
19638
  method: "play",
@@ -49547,6 +49602,244 @@ var controlCapability = {
49547
49602
  */
49548
49603
  history: "none"
49549
49604
  };
49605
+ /**
49606
+ * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
49607
+ * Apple TV, Spotify, Roku, generic OTT receivers, …) on
49608
+ * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
49609
+ * surface — those use `DeviceType.Camera` + the broker pipeline.
49610
+ *
49611
+ * The cap declares a wide method surface; not every backend supports
49612
+ * every method. Drivers signal sub-capability via the
49613
+ * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
49614
+ * corresponding method) so the UI gates buttons without a slice
49615
+ * fetch — same pattern as `PanTiltZoom` for cameras.
49616
+ */
49617
+ var MediaPlayerStateSchema = _enum([
49618
+ "off",
49619
+ "on",
49620
+ "idle",
49621
+ "playing",
49622
+ "paused",
49623
+ "buffering",
49624
+ "standby"
49625
+ ]);
49626
+ var MediaPlayerRepeatSchema = _enum([
49627
+ "off",
49628
+ "all",
49629
+ "one"
49630
+ ]);
49631
+ var MediaInfoSchema = object({
49632
+ /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
49633
+ * `podcast`, …). */
49634
+ type: string(),
49635
+ /** Human-readable title. */
49636
+ title: string(),
49637
+ /** Optional artist / channel / station label. */
49638
+ artist: string().optional(),
49639
+ /** Optional album / season / show name. */
49640
+ album: string().optional(),
49641
+ /** Optional cover-art / thumbnail URL. */
49642
+ imageUrl: string().optional()
49643
+ });
49644
+ /**
49645
+ * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
49646
+ * the device said so. `assumed`: the driver has no feedback (infrared) and
49647
+ * tracks what it last SENT; it moves only after a send was accepted, and a
49648
+ * human at the real remote makes it wrong. A UI shows an assumed value as a
49649
+ * guess, never as a reading.
49650
+ */
49651
+ var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
49652
+ /** The fields of a media-player status a driver can only guess. */
49653
+ var MediaPlayerAssumedFieldSchema = _enum([
49654
+ "state",
49655
+ "volumeLevel",
49656
+ "isMuted",
49657
+ "source"
49658
+ ]);
49659
+ var MediaPlayerStatusSchema = object({
49660
+ /** Playback lifecycle state. */
49661
+ state: MediaPlayerStateSchema,
49662
+ /**
49663
+ * Whether the state fields are readings or the driver's own bookkeeping.
49664
+ * A slice written before this field existed parses as `reported`.
49665
+ */
49666
+ stateSource: MediaPlayerStateSourceSchema.default("reported"),
49667
+ /**
49668
+ * Which fields are the driver's own guess. `stateSource` is `assumed` when
49669
+ * this is not empty; a field not listed here is a reading even then (power
49670
+ * from a running-state source, mute guessed from the last send).
49671
+ */
49672
+ assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
49673
+ /** Volume as 0..100 inclusive. Null when the device has no volume
49674
+ * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
49675
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
49676
+ /** Mute toggle distinct from volume=0. Null when no mute surface.
49677
+ * Pair with `DeviceFeature.MediaPlayerMute`. */
49678
+ isMuted: boolean().nullable(),
49679
+ /** Active source / input. Empty when no source surface. */
49680
+ source: string(),
49681
+ /** Selectable sources. Empty when no source surface.
49682
+ * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
49683
+ availableSources: array(string()),
49684
+ /** Currently-playing media info. Null when nothing is playing. */
49685
+ currentMedia: MediaInfoSchema.nullable(),
49686
+ /** Current playback position in ms. Null when not seekable or
49687
+ * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
49688
+ position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
49689
+ /** Total duration of the current media in ms. Null when unknown
49690
+ * (live stream) or nothing is playing. */
49691
+ duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
49692
+ /** Shuffle toggle. Null when no shuffle surface.
49693
+ * Pair with `DeviceFeature.MediaPlayerShuffle`. */
49694
+ shuffle: boolean().nullable(),
49695
+ /** Repeat mode. Null when no repeat surface.
49696
+ * Pair with `DeviceFeature.MediaPlayerRepeat`. */
49697
+ repeat: MediaPlayerRepeatSchema.nullable(),
49698
+ /** Ms epoch when the slice was last updated. */
49699
+ lastChangedAt: number()
49700
+ });
49701
+ var stepInput = object({
49702
+ deviceId: number().int().nonnegative(),
49703
+ /** How many presses: the caller's count (Alexa `volumeSteps`, `channelCount`). */
49704
+ steps: number().int().min(1).max(50).default(1)
49705
+ });
49706
+ var deviceOnly = object({ deviceId: number().int().nonnegative() });
49707
+ var mediaPlayerCapability = {
49708
+ name: "media-player",
49709
+ scope: "device",
49710
+ deviceNative: true,
49711
+ mode: "singleton",
49712
+ deviceTypes: [DeviceType.MediaPlayer],
49713
+ methods: {
49714
+ turnOn: method(deviceOnly, _void(), {
49715
+ kind: "mutation",
49716
+ auth: "protected"
49717
+ }),
49718
+ turnOff: method(deviceOnly, _void(), {
49719
+ kind: "mutation",
49720
+ auth: "protected"
49721
+ }),
49722
+ volumeUp: method(stepInput, _void(), {
49723
+ kind: "mutation",
49724
+ auth: "protected"
49725
+ }),
49726
+ volumeDown: method(stepInput, _void(), {
49727
+ kind: "mutation",
49728
+ auth: "protected"
49729
+ }),
49730
+ channelUp: method(stepInput, _void(), {
49731
+ kind: "mutation",
49732
+ auth: "protected"
49733
+ }),
49734
+ channelDown: method(stepInput, _void(), {
49735
+ kind: "mutation",
49736
+ auth: "protected"
49737
+ }),
49738
+ play: method(object({ deviceId: number().int().nonnegative() }), _void(), {
49739
+ kind: "mutation",
49740
+ auth: "protected"
49741
+ }),
49742
+ pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
49743
+ kind: "mutation",
49744
+ auth: "protected"
49745
+ }),
49746
+ stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
49747
+ kind: "mutation",
49748
+ auth: "protected"
49749
+ }),
49750
+ next: method(object({ deviceId: number().int().nonnegative() }), _void(), {
49751
+ kind: "mutation",
49752
+ auth: "protected"
49753
+ }),
49754
+ previous: method(object({ deviceId: number().int().nonnegative() }), _void(), {
49755
+ kind: "mutation",
49756
+ auth: "protected"
49757
+ }),
49758
+ seek: method(object({
49759
+ deviceId: number().int().nonnegative(),
49760
+ position: number().int().nonnegative()
49761
+ }), _void(), {
49762
+ kind: "mutation",
49763
+ auth: "protected"
49764
+ }),
49765
+ setVolume: method(object({
49766
+ deviceId: number().int().nonnegative(),
49767
+ volumeLevel: number().min(0).max(100)
49768
+ }), _void(), {
49769
+ kind: "mutation",
49770
+ auth: "protected"
49771
+ }),
49772
+ setMute: method(object({
49773
+ deviceId: number().int().nonnegative(),
49774
+ muted: boolean()
49775
+ }), _void(), {
49776
+ kind: "mutation",
49777
+ auth: "protected"
49778
+ }),
49779
+ setShuffle: method(object({
49780
+ deviceId: number().int().nonnegative(),
49781
+ shuffle: boolean()
49782
+ }), _void(), {
49783
+ kind: "mutation",
49784
+ auth: "protected"
49785
+ }),
49786
+ setRepeat: method(object({
49787
+ deviceId: number().int().nonnegative(),
49788
+ repeat: MediaPlayerRepeatSchema
49789
+ }), _void(), {
49790
+ kind: "mutation",
49791
+ auth: "protected"
49792
+ }),
49793
+ selectSource: method(object({
49794
+ deviceId: number().int().nonnegative(),
49795
+ source: string().min(1)
49796
+ }), _void(), {
49797
+ kind: "mutation",
49798
+ auth: "protected"
49799
+ }),
49800
+ playMedia: method(object({
49801
+ deviceId: number().int().nonnegative(),
49802
+ /** Media identifier / URL. */
49803
+ mediaId: string().min(1),
49804
+ /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
49805
+ * passes it through to the upstream service. */
49806
+ mediaType: string().min(1)
49807
+ }), _void(), {
49808
+ kind: "mutation",
49809
+ auth: "protected"
49810
+ })
49811
+ },
49812
+ status: {
49813
+ schema: MediaPlayerStatusSchema,
49814
+ kind: "push"
49815
+ },
49816
+ /**
49817
+ * Runtime-state slice — mirrored by the kernel. UI players read the
49818
+ * full slice for live now-playing, volume, and progress updates
49819
+ * without polling.
49820
+ */
49821
+ runtimeState: MediaPlayerStatusSchema,
49822
+ /**
49823
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
49824
+ *
49825
+ * See `RuntimeStateDurability`. Enforced by
49826
+ * `scripts/check-runtime-state-durability.ts`.
49827
+ */
49828
+ durability: "session",
49829
+ /**
49830
+ * History (D850): volume (a level an operator or an automation sets; the
49831
+ * default 10 s floor folds a slider drag into its end value) and mute.
49832
+ * `position` is not recorded: it moves continuously while playing.
49833
+ */
49834
+ history: { fields: {
49835
+ volumeLevel: {
49836
+ kind: "gauge",
49837
+ unit: "%",
49838
+ deadband: 1
49839
+ },
49840
+ isMuted: { kind: "boolean" }
49841
+ } }
49842
+ };
49550
49843
  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;
49551
49844
  var NUMBER = {
49552
49845
  kind: "fixed",
@@ -58300,214 +58593,6 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
58300
58593
  ]);
58301
58594
  method(_void(), array(LoginMethodContributionSchema).readonly());
58302
58595
  /**
58303
- * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
58304
- * Apple TV, Spotify, Roku, generic OTT receivers, …) on
58305
- * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
58306
- * surface — those use `DeviceType.Camera` + the broker pipeline.
58307
- *
58308
- * The cap declares a wide method surface; not every backend supports
58309
- * every method. Drivers signal sub-capability via the
58310
- * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
58311
- * corresponding method) so the UI gates buttons without a slice
58312
- * fetch — same pattern as `PanTiltZoom` for cameras.
58313
- */
58314
- var MediaPlayerStateSchema = _enum([
58315
- "off",
58316
- "on",
58317
- "idle",
58318
- "playing",
58319
- "paused",
58320
- "buffering",
58321
- "standby"
58322
- ]);
58323
- var MediaPlayerRepeatSchema = _enum([
58324
- "off",
58325
- "all",
58326
- "one"
58327
- ]);
58328
- var MediaInfoSchema = object({
58329
- /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
58330
- * `podcast`, …). */
58331
- type: string(),
58332
- /** Human-readable title. */
58333
- title: string(),
58334
- /** Optional artist / channel / station label. */
58335
- artist: string().optional(),
58336
- /** Optional album / season / show name. */
58337
- album: string().optional(),
58338
- /** Optional cover-art / thumbnail URL. */
58339
- imageUrl: string().optional()
58340
- });
58341
- /**
58342
- * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
58343
- * the device said so. `assumed`: the driver has no feedback (infrared) and
58344
- * tracks what it last SENT; it moves only after a send was accepted, and a
58345
- * human at the real remote makes it wrong. A UI shows an assumed value as a
58346
- * guess, never as a reading.
58347
- */
58348
- var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
58349
- /** The fields of a media-player status a driver can only guess. */
58350
- var MediaPlayerAssumedFieldSchema = _enum([
58351
- "state",
58352
- "volumeLevel",
58353
- "isMuted",
58354
- "source"
58355
- ]);
58356
- var MediaPlayerStatusSchema = object({
58357
- /** Playback lifecycle state. */
58358
- state: MediaPlayerStateSchema,
58359
- /**
58360
- * Whether the state fields are readings or the driver's own bookkeeping.
58361
- * A slice written before this field existed parses as `reported`.
58362
- */
58363
- stateSource: MediaPlayerStateSourceSchema.default("reported"),
58364
- /**
58365
- * Which fields are the driver's own guess. `stateSource` is `assumed` when
58366
- * this is not empty; a field not listed here is a reading even then (power
58367
- * from a running-state source, mute guessed from the last send).
58368
- */
58369
- assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
58370
- /** Volume as 0..100 inclusive. Null when the device has no volume
58371
- * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
58372
- volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58373
- /** Mute toggle distinct from volume=0. Null when no mute surface.
58374
- * Pair with `DeviceFeature.MediaPlayerMute`. */
58375
- isMuted: boolean().nullable(),
58376
- /** Active source / input. Empty when no source surface. */
58377
- source: string(),
58378
- /** Selectable sources. Empty when no source surface.
58379
- * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
58380
- availableSources: array(string()),
58381
- /** Currently-playing media info. Null when nothing is playing. */
58382
- currentMedia: MediaInfoSchema.nullable(),
58383
- /** Current playback position in ms. Null when not seekable or
58384
- * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
58385
- position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
58386
- /** Total duration of the current media in ms. Null when unknown
58387
- * (live stream) or nothing is playing. */
58388
- duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
58389
- /** Shuffle toggle. Null when no shuffle surface.
58390
- * Pair with `DeviceFeature.MediaPlayerShuffle`. */
58391
- shuffle: boolean().nullable(),
58392
- /** Repeat mode. Null when no repeat surface.
58393
- * Pair with `DeviceFeature.MediaPlayerRepeat`. */
58394
- repeat: MediaPlayerRepeatSchema.nullable(),
58395
- /** Ms epoch when the slice was last updated. */
58396
- lastChangedAt: number()
58397
- });
58398
- var mediaPlayerCapability = {
58399
- name: "media-player",
58400
- scope: "device",
58401
- deviceNative: true,
58402
- mode: "singleton",
58403
- deviceTypes: [DeviceType.MediaPlayer],
58404
- methods: {
58405
- play: method(object({ deviceId: number().int().nonnegative() }), _void(), {
58406
- kind: "mutation",
58407
- auth: "protected"
58408
- }),
58409
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
58410
- kind: "mutation",
58411
- auth: "protected"
58412
- }),
58413
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
58414
- kind: "mutation",
58415
- auth: "protected"
58416
- }),
58417
- next: method(object({ deviceId: number().int().nonnegative() }), _void(), {
58418
- kind: "mutation",
58419
- auth: "protected"
58420
- }),
58421
- previous: method(object({ deviceId: number().int().nonnegative() }), _void(), {
58422
- kind: "mutation",
58423
- auth: "protected"
58424
- }),
58425
- seek: method(object({
58426
- deviceId: number().int().nonnegative(),
58427
- position: number().int().nonnegative()
58428
- }), _void(), {
58429
- kind: "mutation",
58430
- auth: "protected"
58431
- }),
58432
- setVolume: method(object({
58433
- deviceId: number().int().nonnegative(),
58434
- volumeLevel: number().min(0).max(100)
58435
- }), _void(), {
58436
- kind: "mutation",
58437
- auth: "protected"
58438
- }),
58439
- setMute: method(object({
58440
- deviceId: number().int().nonnegative(),
58441
- muted: boolean()
58442
- }), _void(), {
58443
- kind: "mutation",
58444
- auth: "protected"
58445
- }),
58446
- setShuffle: method(object({
58447
- deviceId: number().int().nonnegative(),
58448
- shuffle: boolean()
58449
- }), _void(), {
58450
- kind: "mutation",
58451
- auth: "protected"
58452
- }),
58453
- setRepeat: method(object({
58454
- deviceId: number().int().nonnegative(),
58455
- repeat: MediaPlayerRepeatSchema
58456
- }), _void(), {
58457
- kind: "mutation",
58458
- auth: "protected"
58459
- }),
58460
- selectSource: method(object({
58461
- deviceId: number().int().nonnegative(),
58462
- source: string().min(1)
58463
- }), _void(), {
58464
- kind: "mutation",
58465
- auth: "protected"
58466
- }),
58467
- playMedia: method(object({
58468
- deviceId: number().int().nonnegative(),
58469
- /** Media identifier / URL. */
58470
- mediaId: string().min(1),
58471
- /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
58472
- * passes it through to the upstream service. */
58473
- mediaType: string().min(1)
58474
- }), _void(), {
58475
- kind: "mutation",
58476
- auth: "protected"
58477
- })
58478
- },
58479
- status: {
58480
- schema: MediaPlayerStatusSchema,
58481
- kind: "push"
58482
- },
58483
- /**
58484
- * Runtime-state slice — mirrored by the kernel. UI players read the
58485
- * full slice for live now-playing, volume, and progress updates
58486
- * without polling.
58487
- */
58488
- runtimeState: MediaPlayerStatusSchema,
58489
- /**
58490
- * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
58491
- *
58492
- * See `RuntimeStateDurability`. Enforced by
58493
- * `scripts/check-runtime-state-durability.ts`.
58494
- */
58495
- durability: "session",
58496
- /**
58497
- * History (D850): volume (a level an operator or an automation sets; the
58498
- * default 10 s floor folds a slider drag into its end value) and mute.
58499
- * `position` is not recorded: it moves continuously while playing.
58500
- */
58501
- history: { fields: {
58502
- volumeLevel: {
58503
- kind: "gauge",
58504
- unit: "%",
58505
- deadband: 1
58506
- },
58507
- isMuted: { kind: "boolean" }
58508
- } }
58509
- };
58510
- /**
58511
58596
  * mesh-network — collection cap for mesh-VPN providers.
58512
58597
  *
58513
58598
  * Different shape from `network-access` (public tunnels):
@@ -74308,7 +74393,13 @@ var RemoteMediaCommandSchema = _enum([
74308
74393
  "next",
74309
74394
  "previous",
74310
74395
  "setMute",
74311
- "selectSource"
74396
+ "selectSource",
74397
+ "turnOn",
74398
+ "turnOff",
74399
+ "volumeUp",
74400
+ "volumeDown",
74401
+ "channelUp",
74402
+ "channelDown"
74312
74403
  ]);
74313
74404
  /** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
74314
74405
  var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
@@ -74329,7 +74420,7 @@ method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.e
74329
74420
  }), RemoteSendResultSchema, {
74330
74421
  kind: "mutation",
74331
74422
  auth: "protected"
74332
- }), method(deviceInput.extend({
74423
+ }), method(deviceInput, MediaPlayerStatusSchema.nullable(), { auth: "protected" }), method(deviceInput.extend({
74333
74424
  command: RemoteMediaCommandSchema,
74334
74425
  muted: boolean().optional(),
74335
74426
  source: string().optional(),
@@ -76583,7 +76674,11 @@ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
76583
76674
  * `getSettingsUISchema()` surface.
76584
76675
  */
76585
76676
  var SwitchStatusSchema = object({
76586
- on: boolean().meta({ label: "On" }),
76677
+ /**
76678
+ * `null` = the device has never reported its state (a measurement that
76679
+ * has not happened is unknown, never `false`).
76680
+ */
76681
+ on: boolean().nullable().meta({ label: "On" }),
76587
76682
  /** Ms epoch of the last state change. Useful for UI "X minutes ago". */
76588
76683
  lastChangedAt: number()
76589
76684
  });
@@ -76608,7 +76703,7 @@ var switchCapability = {
76608
76703
  }) },
76609
76704
  events: { onStateChanged: { data: object({
76610
76705
  deviceId: number(),
76611
- on: boolean(),
76706
+ on: boolean().nullable(),
76612
76707
  lastChangedAt: number()
76613
76708
  }) } },
76614
76709
  status: {
@@ -80291,6 +80386,7 @@ function buildDescriptor(capName, kind) {
80291
80386
  * contributes one entry per bound cap present in this map.
80292
80387
  */
80293
80388
  var EVENT_KIND_BY_CAP = Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
80389
+ DeviceFeature.MediaPlayerPower, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious;
80294
80390
  var btn = (idSuffix, row, col, init) => ({
80295
80391
  idSuffix,
80296
80392
  row,
@@ -86506,6 +86602,20 @@ Object.freeze({
86506
86602
  access: "view",
86507
86603
  role: "admin"
86508
86604
  },
86605
+ "mediaPlayer.channelDown": {
86606
+ capName: "media-player",
86607
+ capScope: "device",
86608
+ addonId: null,
86609
+ access: "create",
86610
+ role: "viewer"
86611
+ },
86612
+ "mediaPlayer.channelUp": {
86613
+ capName: "media-player",
86614
+ capScope: "device",
86615
+ addonId: null,
86616
+ access: "create",
86617
+ role: "viewer"
86618
+ },
86509
86619
  "mediaPlayer.getStatus": {
86510
86620
  capName: "media-player",
86511
86621
  capScope: "device",
@@ -86597,6 +86707,34 @@ Object.freeze({
86597
86707
  access: "create",
86598
86708
  role: "viewer"
86599
86709
  },
86710
+ "mediaPlayer.turnOff": {
86711
+ capName: "media-player",
86712
+ capScope: "device",
86713
+ addonId: null,
86714
+ access: "create",
86715
+ role: "viewer"
86716
+ },
86717
+ "mediaPlayer.turnOn": {
86718
+ capName: "media-player",
86719
+ capScope: "device",
86720
+ addonId: null,
86721
+ access: "create",
86722
+ role: "viewer"
86723
+ },
86724
+ "mediaPlayer.volumeDown": {
86725
+ capName: "media-player",
86726
+ capScope: "device",
86727
+ addonId: null,
86728
+ access: "create",
86729
+ role: "viewer"
86730
+ },
86731
+ "mediaPlayer.volumeUp": {
86732
+ capName: "media-player",
86733
+ capScope: "device",
86734
+ addonId: null,
86735
+ access: "create",
86736
+ role: "viewer"
86737
+ },
86600
86738
  "meshNetwork.getStatus": {
86601
86739
  capName: "mesh-network",
86602
86740
  capScope: "system",
@@ -90153,6 +90291,13 @@ Object.freeze({
90153
90291
  access: "create",
90154
90292
  role: "admin"
90155
90293
  },
90294
+ "remote.getAssumedStatus": {
90295
+ capName: "remote",
90296
+ capScope: "system",
90297
+ addonId: null,
90298
+ access: "view",
90299
+ role: "admin"
90300
+ },
90156
90301
  "remote.getConfig": {
90157
90302
  capName: "remote",
90158
90303
  capScope: "system",
@@ -93830,6 +93975,16 @@ Object.freeze({
93830
93975
  form: "single",
93831
93976
  optional: true
93832
93977
  }],
93978
+ "mediaPlayer.channelDown": [{
93979
+ name: "deviceId",
93980
+ form: "single",
93981
+ optional: false
93982
+ }],
93983
+ "mediaPlayer.channelUp": [{
93984
+ name: "deviceId",
93985
+ form: "single",
93986
+ optional: false
93987
+ }],
93833
93988
  "mediaPlayer.getStatus": [{
93834
93989
  name: "deviceId",
93835
93990
  form: "single",
@@ -93895,6 +94050,26 @@ Object.freeze({
93895
94050
  form: "single",
93896
94051
  optional: false
93897
94052
  }],
94053
+ "mediaPlayer.turnOff": [{
94054
+ name: "deviceId",
94055
+ form: "single",
94056
+ optional: false
94057
+ }],
94058
+ "mediaPlayer.turnOn": [{
94059
+ name: "deviceId",
94060
+ form: "single",
94061
+ optional: false
94062
+ }],
94063
+ "mediaPlayer.volumeDown": [{
94064
+ name: "deviceId",
94065
+ form: "single",
94066
+ optional: false
94067
+ }],
94068
+ "mediaPlayer.volumeUp": [{
94069
+ name: "deviceId",
94070
+ form: "single",
94071
+ optional: false
94072
+ }],
93898
94073
  "meter.getStatus": [{
93899
94074
  name: "deviceId",
93900
94075
  form: "single",
@@ -95060,6 +95235,11 @@ Object.freeze({
95060
95235
  form: "single",
95061
95236
  optional: true
95062
95237
  }],
95238
+ "remote.getAssumedStatus": [{
95239
+ name: "deviceId",
95240
+ form: "single",
95241
+ optional: false
95242
+ }],
95063
95243
  "remote.getConfig": [{
95064
95244
  name: "deviceId",
95065
95245
  form: "single",
@@ -97483,7 +97663,7 @@ object({
97483
97663
  * short-circuits any cap the calling process already provides.
97484
97664
  */
97485
97665
  /** The addon that owns the import direction, and every `ha_*` broker. */
97486
- var HA_PROVIDER_ADDON_ID = "provider-homeassistant";
97666
+ var HA_PROVIDER_ADDON_ID$1 = "provider-homeassistant";
97487
97667
  /** The `BrokerInfo.kind` tag the Home Assistant provider stamps. */
97488
97668
  var HA_BROKER_KIND = "home-assistant";
97489
97669
  /**
@@ -97497,5 +97677,53 @@ var HA_BROKER_KIND = "home-assistant";
97497
97677
  async function listHomeAssistantBrokers(query) {
97498
97678
  return (await query({})).filter((broker) => broker.kind === HA_BROKER_KIND);
97499
97679
  }
97680
+ function haInstanceSettingsPortsOver(api) {
97681
+ const listInstances = async () => {
97682
+ const all = await api.list.query();
97683
+ const rows = [];
97684
+ for (const integration of all) {
97685
+ if (integration.addonId !== "provider-homeassistant") continue;
97686
+ const settings = await api.getSettings.query({ id: integration.id });
97687
+ const brokerId = settings["brokerId"];
97688
+ rows.push({
97689
+ integrationId: integration.id,
97690
+ brokerId: typeof brokerId === "string" && brokerId.length > 0 ? brokerId : null,
97691
+ settings
97692
+ });
97693
+ }
97694
+ return rows;
97695
+ };
97696
+ return {
97697
+ listInstances,
97698
+ patchInstanceSettings: async (integrationId, patch) => {
97699
+ if (!(await api.list.query()).some((i) => i.id === integrationId && i.addonId === "provider-homeassistant")) return false;
97700
+ const stored = await api.getSettings.query({ id: integrationId });
97701
+ await api.setSettings.mutate({
97702
+ id: integrationId,
97703
+ settings: {
97704
+ ...stored,
97705
+ ...patch
97706
+ },
97707
+ skipRestart: true
97708
+ });
97709
+ return true;
97710
+ }
97711
+ };
97712
+ }
97713
+ /** The brokerId → settings view of the instances: what a reader keeps per broker. */
97714
+ function settingsByBroker(rows) {
97715
+ const out = /* @__PURE__ */ new Map();
97716
+ for (const row of rows) if (row.brokerId !== null) out.set(row.brokerId, row.settings);
97717
+ return out;
97718
+ }
97719
+ /** Read the instances, or report why not and answer nothing (a reader falls back to the legacy key). */
97720
+ async function listInstancesOrNothing(ports, onError) {
97721
+ try {
97722
+ return await ports.listInstances();
97723
+ } catch (err) {
97724
+ onError(errMsg(err));
97725
+ return [];
97726
+ }
97727
+ }
97500
97728
  //#endregion
97501
- export { humidifierCapability as $, boolean as $t, brightnessCapability as A, switchCapability as At, consumableFormOf as B, weatherCapability as Bt, alarmPanelCapability as C, runningFromLawnMower as Ct, bestLocationMatch as D, scriptRunnerCapability as Dt, batteryCapability as E, runningStateCapability as Et, calendarSourceCapability as F, updateCapability as Ft, deviceAdminLinkCapability as G, defineAddonMigrations as Gt, contactCapability as H, RecordSecretUnavailableError as Ht, carbonMonoxideCapability as I, vacuumControlCapability as It, enumSensorCapability as J, entryBody as Jt, deviceAdoptionCapability as K, defineEntryKind as Kt, climateControlCapability as L, valveCapability as Lt, buildAddonRouteProvider as M, temperatureSensorCapability as Mt, buildDeviceAdminUrl as N, tryConvertDelta as Nt, binaryCapability as O, sendToExportedTarget as Ot, buttonCapability as P, tryConvertUnit as Pt, gasCapability as Q, array as Qt, colorCapability as R, vibrationCapability as Rt, airQualitySensorCapability as S, runExportedAction as St, automationControlCapability as T, runningFromVacuumState as Tt, controlCapability as U, baseUnitOf as Ut, consumableKindOf as V, BaseAddon as Vt, coverCapability as W, createEvent as Wt, fanControlCapability as X, nodePin as Xt, eventEmitterCapability as Y, isReadingQuantity as Yt, floodCapability as Z, _enum as Zt, PLUG_APPLIANCE_TYPES as _, pressureSensorCapability as _t, BaseDevice as a, string as an, mediaPlayerCapability as at, accessoriesCapability as b, quantityFromUnit as bt, COCO_TO_MACRO as c, url as cn, notificationOutputCapability as ct, ConsumableItemSchema as d, DeviceType as dn, oauthIntegrationCapability as dt, discriminatedUnion as en, humiditySensorCapability as et, ConsumableStatusSchema as f, errMsg as fn, parseAdminBase as ft, MediaPlayerRepeatSchema as g, presenceCapability as gt, HvacModeSchema as h, prepareNotification as ht, AlarmArmModeSchema as i, record as in, lockControlCapability as it, brokerCapability as j, tamperCapability as jt, boardKeySourceCapability as k, smokeCapability as kt, CameraSwitchIdSchema as l, DeviceFeature as ln, notifierCapability as lt, FanDirectionSchema as m, preconditionOf as mt, HA_PROVIDER_ADDON_ID as n, number as nn, ingestReading as nt, BaseDeviceProvider as o, union as on, motionCapability as ot, EnumSensorDateTimeFormatSchema as p, EventCategory as pn, powerMeterCapability as pt, deviceExportCapability as q, defineRecordKinds as qt, listHomeAssistantBrokers as r, object as rn, lawnMowerControlCapability as rt, CAMERA_SWITCH_ORDER as s, unknown as sn, normalizeUnit as st, HA_BROKER_KIND as t, literal as tn, imageCapability as tt, ConsumableFormSchema as u, DeviceRole as un, numericSensorCapability as ut, RUNNING_STATE_COLD as v, pruneDeletedEntities as vt, ambientLightSensorCapability as w, runningFromMediaPlayer as wt, addonRoutesCapability as x, resolveAttachmentUrls as xt, TargetSchema as y, publicEndpointReaderFrom as yt, connectivityCapability as z, waterHeaterCapability as zt };
97729
+ export { fanControlCapability as $, nodePin as $t, bestLocationMatch as A, scriptRunnerCapability as At, climateControlCapability as B, valveCapability as Bt, accessoriesCapability as C, quantityFromUnit as Ct, ambientLightSensorCapability as D, runningFromMediaPlayer as Dt, alarmPanelCapability as E, runningFromLawnMower as Et, buildAddonRouteProvider as F, temperatureSensorCapability as Ft, contactCapability as G, RecordSecretUnavailableError as Gt, connectivityCapability as H, waterHeaterCapability as Ht, buildDeviceAdminUrl as I, tryConvertDelta as It, deviceAdminLinkCapability as J, defineAddonMigrations as Jt, controlCapability as K, baseUnitOf as Kt, buttonCapability as L, tryConvertUnit as Lt, boardKeySourceCapability as M, smokeCapability as Mt, brightnessCapability as N, switchCapability as Nt, automationControlCapability as O, runningFromVacuumState as Ot, brokerCapability as P, tamperCapability as Pt, eventEmitterCapability as Q, isReadingQuantity as Qt, calendarSourceCapability as R, updateCapability as Rt, TargetSchema as S, publicEndpointReaderFrom as St, airQualitySensorCapability as T, runExportedAction as Tt, consumableFormOf as U, weatherCapability as Ut, colorCapability as V, vibrationCapability as Vt, consumableKindOf as W, BaseAddon as Wt, deviceExportCapability as X, defineRecordKinds as Xt, deviceAdoptionCapability as Y, defineEntryKind as Yt, enumSensorCapability as Z, entryBody as Zt, FanDirectionSchema as _, preconditionOf as _t, HA_PROVIDER_ADDON_ID$1 as a, number as an, ingestReading as at, PLUG_APPLIANCE_TYPES as b, pressureSensorCapability as bt, BaseDevice as c, string as cn, mediaPlayerCapability as ct, COCO_TO_MACRO as d, url as dn, notificationOutputCapability as dt, _enum as en, floodCapability as et, CameraSwitchIdSchema as f, DeviceFeature as fn, notifierCapability as ft, EnumSensorDateTimeFormatSchema as g, EventCategory as gn, powerMeterCapability as gt, ConsumableStatusSchema as h, errMsg as hn, parseAdminBase as ht, HA_BROKER_KIND as i, literal as in, imageCapability as it, binaryCapability as j, sendToExportedTarget as jt, batteryCapability as k, runningStateCapability as kt, BaseDeviceProvider as l, union as ln, motionCapability as lt, ConsumableItemSchema as m, DeviceType as mn, oauthIntegrationCapability as mt, listInstancesOrNothing as n, boolean as nn, humidifierCapability as nt, listHomeAssistantBrokers as o, object as on, lawnMowerControlCapability as ot, ConsumableFormSchema as p, DeviceRole as pn, numericSensorCapability as pt, coverCapability as q, createEvent as qt, settingsByBroker as r, discriminatedUnion as rn, humiditySensorCapability as rt, AlarmArmModeSchema as s, record as sn, lockControlCapability as st, haInstanceSettingsPortsOver as t, array as tn, gasCapability as tt, CAMERA_SWITCH_ORDER as u, unknown as un, normalizeUnit as ut, HvacModeSchema as v, prepareNotification as vt, addonRoutesCapability as w, resolveAttachmentUrls as wt, RUNNING_STATE_COLD as x, pruneDeletedEntities as xt, MediaPlayerRepeatSchema as y, presenceCapability as yt, carbonMonoxideCapability as z, vacuumControlCapability as zt };