@camstack/addon-matter-broker 0.1.8 → 0.1.9

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/dist/addon.js CHANGED
@@ -4656,7 +4656,7 @@ function preprocess(fn, schema) {
4656
4656
  });
4657
4657
  }
4658
4658
  //#endregion
4659
- //#region ../types/dist/sleep-B3AOslwX.mjs
4659
+ //#region ../types/dist/sleep-C2M2zF7x.mjs
4660
4660
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4661
4661
  EventCategory["SystemBoot"] = "system.boot";
4662
4662
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -6224,6 +6224,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6224
6224
  DeviceType["Switch"] = "switch";
6225
6225
  DeviceType["Sensor"] = "sensor";
6226
6226
  DeviceType["Thermostat"] = "thermostat";
6227
+ /** Air-conditioner / heat-pump climate device (HVAC) — shares the
6228
+ * `climate-control` cap surface with `Thermostat` but renders a
6229
+ * dedicated AC-appropriate control UI (mode chips, fan speed,
6230
+ * independent vertical/horizontal swing). Sources: native Gree, and
6231
+ * reusable by other AC integrations. */
6232
+ DeviceType["Climate"] = "climate";
6227
6233
  DeviceType["Button"] = "button";
6228
6234
  /** Generic stateless event emitter — carries a device's EXACT declared
6229
6235
  * event vocabulary verbatim (no normalization). Installed with the
@@ -9019,7 +9025,7 @@ var climateControlCapability = {
9019
9025
  scope: "device",
9020
9026
  deviceNative: true,
9021
9027
  mode: "singleton",
9022
- deviceTypes: [DeviceType.Thermostat],
9028
+ deviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
9023
9029
  methods: {
9024
9030
  setMode: method(object({
9025
9031
  deviceId: number().int().nonnegative(),
@@ -13618,10 +13624,30 @@ var deviceProviderCapability = {
13618
13624
  type: string$2()
13619
13625
  }))),
13620
13626
  supportsDiscovery: method(object({}), boolean()),
13621
- discoverDevices: method(object({}), array(DiscoveryCandidateSchema), {
13627
+ /**
13628
+ * Run a network scan. `params` carries optional provider-specific scan
13629
+ * inputs (e.g. a broadcast address / subnet for cross-subnet discovery),
13630
+ * shaped by `getDiscoveryParamsSchema`. Omitted for the generic scan
13631
+ * (provider uses its local-network default).
13632
+ */
13633
+ discoverDevices: method(object({ params: record(string$2(), unknown()).optional() }), array(DiscoveryCandidateSchema), {
13622
13634
  kind: "mutation",
13623
13635
  auth: "admin"
13624
13636
  }),
13637
+ /**
13638
+ * Optional form schema (`ConfigUISchema`) for the EXTRA per-scan inputs a
13639
+ * provider accepts (e.g. Gree's broadcast address for a different subnet).
13640
+ * `null` when the provider takes no extra scan params — the generic
13641
+ * aggregated scan never renders this; the per-integration scan does.
13642
+ */
13643
+ getDiscoveryParamsSchema: method(object({}), CreationSchemaOutputSchema),
13644
+ /**
13645
+ * The DeviceType this provider creates via manual add (Camera for
13646
+ * Reolink/ONVIF, Container for Gree, Hub for Ecowitt). `null` when the
13647
+ * provider does not support manual creation. Lets the Add-Device dialog
13648
+ * pick the right type instead of assuming Camera.
13649
+ */
13650
+ getManualCreationType: method(object({}), object({ deviceType: _enum(DeviceType).nullable() })),
13625
13651
  adoptDiscoveredDevice: method(object({ candidate: DiscoveryCandidateSchema }), DeviceSummarySchema, {
13626
13652
  kind: "mutation",
13627
13653
  auth: "admin"
@@ -13745,9 +13771,23 @@ var BaseDeviceProvider = class extends BaseAddon {
13745
13771
  async supportsDiscovery() {
13746
13772
  return false;
13747
13773
  }
13748
- async discoverDevices() {
13774
+ async discoverDevices(_input) {
13749
13775
  return [];
13750
13776
  }
13777
+ /** Extra per-scan input form (e.g. a broadcast address for another subnet).
13778
+ * Null = no extra params. Override in providers that support scoped scans. */
13779
+ async getDiscoveryParamsSchema() {
13780
+ return null;
13781
+ }
13782
+ /**
13783
+ * The DeviceType this provider creates via manual add — derived from the
13784
+ * `deviceClasses` map (first registered type). `null` when manual creation is
13785
+ * unsupported. Lets the Add-Device dialog pick the right type per provider.
13786
+ */
13787
+ async getManualCreationType() {
13788
+ if (!await this.supportsManualCreation()) return { deviceType: null };
13789
+ return { deviceType: Object.values(DeviceType).find((t) => this.deviceClasses[t] !== void 0) ?? null };
13790
+ }
13751
13791
  async adoptDiscoveredDevice(_input) {
13752
13792
  throw new Error(`${this.providerName} provider does not support discovery-based adoption`);
13753
13793
  }
@@ -15658,7 +15698,10 @@ method(object({
15658
15698
  }), FieldProbeResultSchema, {
15659
15699
  kind: "mutation",
15660
15700
  auth: "admin"
15661
- }), method(ListCandidatesInputSchema.extend({ addonId: string$2() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15701
+ }), method(object({
15702
+ addonId: string$2(),
15703
+ integrationId: string$2()
15704
+ }), object({ filters: array(AdoptionFilterSchema) }), { auth: "admin" }), method(ListCandidatesInputSchema.extend({ addonId: string$2() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15662
15705
  addonId: string$2(),
15663
15706
  integrationId: string$2()
15664
15707
  }), AdoptionStatusSchema, {
@@ -15673,7 +15716,24 @@ method(object({
15673
15716
  }), method(ResyncInputSchema, ResyncResultSchema, {
15674
15717
  kind: "mutation",
15675
15718
  auth: "admin"
15719
+ }), method(object({}), object({ providers: array(object({
15720
+ addonId: string$2(),
15721
+ label: string$2()
15722
+ })).readonly() }), { auth: "admin" }), method(object({}), object({ groups: array(object({
15723
+ addonId: string$2(),
15724
+ label: string$2(),
15725
+ candidates: array(DiscoveryCandidateSchema).readonly(),
15726
+ error: string$2().nullable()
15727
+ })).readonly() }), {
15728
+ kind: "mutation",
15729
+ auth: "admin"
15676
15730
  }), method(object({
15731
+ addonId: string$2(),
15732
+ params: record(string$2(), unknown()).optional()
15733
+ }), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
15734
+ kind: "mutation",
15735
+ auth: "admin"
15736
+ }), method(object({ addonId: string$2() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string$2() }), unknown(), { auth: "admin" }), method(object({
15677
15737
  deviceId: number(),
15678
15738
  key: string$2(),
15679
15739
  value: unknown()
@@ -20813,6 +20873,12 @@ Object.freeze({
20813
20873
  addonId: null,
20814
20874
  access: "create"
20815
20875
  },
20876
+ "deviceManager.adoptionListCandidateFilters": {
20877
+ capName: "device-manager",
20878
+ capScope: "system",
20879
+ addonId: null,
20880
+ access: "view"
20881
+ },
20816
20882
  "deviceManager.adoptionListCandidates": {
20817
20883
  capName: "device-manager",
20818
20884
  capScope: "system",
@@ -20861,12 +20927,30 @@ Object.freeze({
20861
20927
  addonId: null,
20862
20928
  access: "create"
20863
20929
  },
20930
+ "deviceManager.discoverAllProviders": {
20931
+ capName: "device-manager",
20932
+ capScope: "system",
20933
+ addonId: null,
20934
+ access: "create"
20935
+ },
20864
20936
  "deviceManager.discoverDevices": {
20865
20937
  capName: "device-manager",
20866
20938
  capScope: "system",
20867
20939
  addonId: null,
20868
20940
  access: "create"
20869
20941
  },
20942
+ "deviceManager.discoverProvider": {
20943
+ capName: "device-manager",
20944
+ capScope: "system",
20945
+ addonId: null,
20946
+ access: "create"
20947
+ },
20948
+ "deviceManager.discoveryProviders": {
20949
+ capName: "device-manager",
20950
+ capScope: "system",
20951
+ addonId: null,
20952
+ access: "view"
20953
+ },
20870
20954
  "deviceManager.enable": {
20871
20955
  capName: "device-manager",
20872
20956
  capScope: "system",
@@ -21017,6 +21101,18 @@ Object.freeze({
21017
21101
  addonId: null,
21018
21102
  access: "create"
21019
21103
  },
21104
+ "deviceManager.providerCreationType": {
21105
+ capName: "device-manager",
21106
+ capScope: "system",
21107
+ addonId: null,
21108
+ access: "view"
21109
+ },
21110
+ "deviceManager.providerDiscoveryParamsSchema": {
21111
+ capName: "device-manager",
21112
+ capScope: "system",
21113
+ addonId: null,
21114
+ access: "view"
21115
+ },
21020
21116
  "deviceManager.registerDevice": {
21021
21117
  capName: "device-manager",
21022
21118
  capScope: "system",
@@ -21233,6 +21329,18 @@ Object.freeze({
21233
21329
  addonId: null,
21234
21330
  access: "view"
21235
21331
  },
21332
+ "deviceProvider.getDiscoveryParamsSchema": {
21333
+ capName: "device-provider",
21334
+ capScope: "system",
21335
+ addonId: null,
21336
+ access: "view"
21337
+ },
21338
+ "deviceProvider.getManualCreationType": {
21339
+ capName: "device-provider",
21340
+ capScope: "system",
21341
+ addonId: null,
21342
+ access: "view"
21343
+ },
21236
21344
  "deviceProvider.getStatus": {
21237
21345
  capName: "device-provider",
21238
21346
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -4654,7 +4654,7 @@ function preprocess(fn, schema) {
4654
4654
  });
4655
4655
  }
4656
4656
  //#endregion
4657
- //#region ../types/dist/sleep-B3AOslwX.mjs
4657
+ //#region ../types/dist/sleep-C2M2zF7x.mjs
4658
4658
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4659
4659
  EventCategory["SystemBoot"] = "system.boot";
4660
4660
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -6222,6 +6222,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6222
6222
  DeviceType["Switch"] = "switch";
6223
6223
  DeviceType["Sensor"] = "sensor";
6224
6224
  DeviceType["Thermostat"] = "thermostat";
6225
+ /** Air-conditioner / heat-pump climate device (HVAC) — shares the
6226
+ * `climate-control` cap surface with `Thermostat` but renders a
6227
+ * dedicated AC-appropriate control UI (mode chips, fan speed,
6228
+ * independent vertical/horizontal swing). Sources: native Gree, and
6229
+ * reusable by other AC integrations. */
6230
+ DeviceType["Climate"] = "climate";
6225
6231
  DeviceType["Button"] = "button";
6226
6232
  /** Generic stateless event emitter — carries a device's EXACT declared
6227
6233
  * event vocabulary verbatim (no normalization). Installed with the
@@ -9017,7 +9023,7 @@ var climateControlCapability = {
9017
9023
  scope: "device",
9018
9024
  deviceNative: true,
9019
9025
  mode: "singleton",
9020
- deviceTypes: [DeviceType.Thermostat],
9026
+ deviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
9021
9027
  methods: {
9022
9028
  setMode: method(object({
9023
9029
  deviceId: number().int().nonnegative(),
@@ -13616,10 +13622,30 @@ var deviceProviderCapability = {
13616
13622
  type: string$2()
13617
13623
  }))),
13618
13624
  supportsDiscovery: method(object({}), boolean()),
13619
- discoverDevices: method(object({}), array(DiscoveryCandidateSchema), {
13625
+ /**
13626
+ * Run a network scan. `params` carries optional provider-specific scan
13627
+ * inputs (e.g. a broadcast address / subnet for cross-subnet discovery),
13628
+ * shaped by `getDiscoveryParamsSchema`. Omitted for the generic scan
13629
+ * (provider uses its local-network default).
13630
+ */
13631
+ discoverDevices: method(object({ params: record(string$2(), unknown()).optional() }), array(DiscoveryCandidateSchema), {
13620
13632
  kind: "mutation",
13621
13633
  auth: "admin"
13622
13634
  }),
13635
+ /**
13636
+ * Optional form schema (`ConfigUISchema`) for the EXTRA per-scan inputs a
13637
+ * provider accepts (e.g. Gree's broadcast address for a different subnet).
13638
+ * `null` when the provider takes no extra scan params — the generic
13639
+ * aggregated scan never renders this; the per-integration scan does.
13640
+ */
13641
+ getDiscoveryParamsSchema: method(object({}), CreationSchemaOutputSchema),
13642
+ /**
13643
+ * The DeviceType this provider creates via manual add (Camera for
13644
+ * Reolink/ONVIF, Container for Gree, Hub for Ecowitt). `null` when the
13645
+ * provider does not support manual creation. Lets the Add-Device dialog
13646
+ * pick the right type instead of assuming Camera.
13647
+ */
13648
+ getManualCreationType: method(object({}), object({ deviceType: _enum(DeviceType).nullable() })),
13623
13649
  adoptDiscoveredDevice: method(object({ candidate: DiscoveryCandidateSchema }), DeviceSummarySchema, {
13624
13650
  kind: "mutation",
13625
13651
  auth: "admin"
@@ -13743,9 +13769,23 @@ var BaseDeviceProvider = class extends BaseAddon {
13743
13769
  async supportsDiscovery() {
13744
13770
  return false;
13745
13771
  }
13746
- async discoverDevices() {
13772
+ async discoverDevices(_input) {
13747
13773
  return [];
13748
13774
  }
13775
+ /** Extra per-scan input form (e.g. a broadcast address for another subnet).
13776
+ * Null = no extra params. Override in providers that support scoped scans. */
13777
+ async getDiscoveryParamsSchema() {
13778
+ return null;
13779
+ }
13780
+ /**
13781
+ * The DeviceType this provider creates via manual add — derived from the
13782
+ * `deviceClasses` map (first registered type). `null` when manual creation is
13783
+ * unsupported. Lets the Add-Device dialog pick the right type per provider.
13784
+ */
13785
+ async getManualCreationType() {
13786
+ if (!await this.supportsManualCreation()) return { deviceType: null };
13787
+ return { deviceType: Object.values(DeviceType).find((t) => this.deviceClasses[t] !== void 0) ?? null };
13788
+ }
13749
13789
  async adoptDiscoveredDevice(_input) {
13750
13790
  throw new Error(`${this.providerName} provider does not support discovery-based adoption`);
13751
13791
  }
@@ -15656,7 +15696,10 @@ method(object({
15656
15696
  }), FieldProbeResultSchema, {
15657
15697
  kind: "mutation",
15658
15698
  auth: "admin"
15659
- }), method(ListCandidatesInputSchema.extend({ addonId: string$2() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15699
+ }), method(object({
15700
+ addonId: string$2(),
15701
+ integrationId: string$2()
15702
+ }), object({ filters: array(AdoptionFilterSchema) }), { auth: "admin" }), method(ListCandidatesInputSchema.extend({ addonId: string$2() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15660
15703
  addonId: string$2(),
15661
15704
  integrationId: string$2()
15662
15705
  }), AdoptionStatusSchema, {
@@ -15671,7 +15714,24 @@ method(object({
15671
15714
  }), method(ResyncInputSchema, ResyncResultSchema, {
15672
15715
  kind: "mutation",
15673
15716
  auth: "admin"
15717
+ }), method(object({}), object({ providers: array(object({
15718
+ addonId: string$2(),
15719
+ label: string$2()
15720
+ })).readonly() }), { auth: "admin" }), method(object({}), object({ groups: array(object({
15721
+ addonId: string$2(),
15722
+ label: string$2(),
15723
+ candidates: array(DiscoveryCandidateSchema).readonly(),
15724
+ error: string$2().nullable()
15725
+ })).readonly() }), {
15726
+ kind: "mutation",
15727
+ auth: "admin"
15674
15728
  }), method(object({
15729
+ addonId: string$2(),
15730
+ params: record(string$2(), unknown()).optional()
15731
+ }), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
15732
+ kind: "mutation",
15733
+ auth: "admin"
15734
+ }), method(object({ addonId: string$2() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string$2() }), unknown(), { auth: "admin" }), method(object({
15675
15735
  deviceId: number(),
15676
15736
  key: string$2(),
15677
15737
  value: unknown()
@@ -20811,6 +20871,12 @@ Object.freeze({
20811
20871
  addonId: null,
20812
20872
  access: "create"
20813
20873
  },
20874
+ "deviceManager.adoptionListCandidateFilters": {
20875
+ capName: "device-manager",
20876
+ capScope: "system",
20877
+ addonId: null,
20878
+ access: "view"
20879
+ },
20814
20880
  "deviceManager.adoptionListCandidates": {
20815
20881
  capName: "device-manager",
20816
20882
  capScope: "system",
@@ -20859,12 +20925,30 @@ Object.freeze({
20859
20925
  addonId: null,
20860
20926
  access: "create"
20861
20927
  },
20928
+ "deviceManager.discoverAllProviders": {
20929
+ capName: "device-manager",
20930
+ capScope: "system",
20931
+ addonId: null,
20932
+ access: "create"
20933
+ },
20862
20934
  "deviceManager.discoverDevices": {
20863
20935
  capName: "device-manager",
20864
20936
  capScope: "system",
20865
20937
  addonId: null,
20866
20938
  access: "create"
20867
20939
  },
20940
+ "deviceManager.discoverProvider": {
20941
+ capName: "device-manager",
20942
+ capScope: "system",
20943
+ addonId: null,
20944
+ access: "create"
20945
+ },
20946
+ "deviceManager.discoveryProviders": {
20947
+ capName: "device-manager",
20948
+ capScope: "system",
20949
+ addonId: null,
20950
+ access: "view"
20951
+ },
20868
20952
  "deviceManager.enable": {
20869
20953
  capName: "device-manager",
20870
20954
  capScope: "system",
@@ -21015,6 +21099,18 @@ Object.freeze({
21015
21099
  addonId: null,
21016
21100
  access: "create"
21017
21101
  },
21102
+ "deviceManager.providerCreationType": {
21103
+ capName: "device-manager",
21104
+ capScope: "system",
21105
+ addonId: null,
21106
+ access: "view"
21107
+ },
21108
+ "deviceManager.providerDiscoveryParamsSchema": {
21109
+ capName: "device-manager",
21110
+ capScope: "system",
21111
+ addonId: null,
21112
+ access: "view"
21113
+ },
21018
21114
  "deviceManager.registerDevice": {
21019
21115
  capName: "device-manager",
21020
21116
  capScope: "system",
@@ -21231,6 +21327,18 @@ Object.freeze({
21231
21327
  addonId: null,
21232
21328
  access: "view"
21233
21329
  },
21330
+ "deviceProvider.getDiscoveryParamsSchema": {
21331
+ capName: "device-provider",
21332
+ capScope: "system",
21333
+ addonId: null,
21334
+ access: "view"
21335
+ },
21336
+ "deviceProvider.getManualCreationType": {
21337
+ capName: "device-provider",
21338
+ capScope: "system",
21339
+ addonId: null,
21340
+ access: "view"
21341
+ },
21234
21342
  "deviceProvider.getStatus": {
21235
21343
  capName: "device-provider",
21236
21344
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-matter-broker",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
5
5
  "keywords": [
6
6
  "camstack",