@camstack/addon-provider-dreo 0.1.6 → 0.1.7

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
@@ -4664,7 +4664,7 @@ function _instanceof(cls, params = {}) {
4664
4664
  return inst;
4665
4665
  }
4666
4666
  //#endregion
4667
- //#region ../types/dist/sleep-B3AOslwX.mjs
4667
+ //#region ../types/dist/sleep-C2M2zF7x.mjs
4668
4668
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4669
4669
  EventCategory["SystemBoot"] = "system.boot";
4670
4670
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -6232,6 +6232,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6232
6232
  DeviceType["Switch"] = "switch";
6233
6233
  DeviceType["Sensor"] = "sensor";
6234
6234
  DeviceType["Thermostat"] = "thermostat";
6235
+ /** Air-conditioner / heat-pump climate device (HVAC) — shares the
6236
+ * `climate-control` cap surface with `Thermostat` but renders a
6237
+ * dedicated AC-appropriate control UI (mode chips, fan speed,
6238
+ * independent vertical/horizontal swing). Sources: native Gree, and
6239
+ * reusable by other AC integrations. */
6240
+ DeviceType["Climate"] = "climate";
6235
6241
  DeviceType["Button"] = "button";
6236
6242
  /** Generic stateless event emitter — carries a device's EXACT declared
6237
6243
  * event vocabulary verbatim (no normalization). Installed with the
@@ -9027,7 +9033,7 @@ var climateControlCapability = {
9027
9033
  scope: "device",
9028
9034
  deviceNative: true,
9029
9035
  mode: "singleton",
9030
- deviceTypes: [DeviceType.Thermostat],
9036
+ deviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
9031
9037
  methods: {
9032
9038
  setMode: method(object({
9033
9039
  deviceId: number().int().nonnegative(),
@@ -13626,10 +13632,30 @@ var deviceProviderCapability = {
13626
13632
  type: string()
13627
13633
  }))),
13628
13634
  supportsDiscovery: method(object({}), boolean()),
13629
- discoverDevices: method(object({}), array(DiscoveryCandidateSchema), {
13635
+ /**
13636
+ * Run a network scan. `params` carries optional provider-specific scan
13637
+ * inputs (e.g. a broadcast address / subnet for cross-subnet discovery),
13638
+ * shaped by `getDiscoveryParamsSchema`. Omitted for the generic scan
13639
+ * (provider uses its local-network default).
13640
+ */
13641
+ discoverDevices: method(object({ params: record(string(), unknown()).optional() }), array(DiscoveryCandidateSchema), {
13630
13642
  kind: "mutation",
13631
13643
  auth: "admin"
13632
13644
  }),
13645
+ /**
13646
+ * Optional form schema (`ConfigUISchema`) for the EXTRA per-scan inputs a
13647
+ * provider accepts (e.g. Gree's broadcast address for a different subnet).
13648
+ * `null` when the provider takes no extra scan params — the generic
13649
+ * aggregated scan never renders this; the per-integration scan does.
13650
+ */
13651
+ getDiscoveryParamsSchema: method(object({}), CreationSchemaOutputSchema),
13652
+ /**
13653
+ * The DeviceType this provider creates via manual add (Camera for
13654
+ * Reolink/ONVIF, Container for Gree, Hub for Ecowitt). `null` when the
13655
+ * provider does not support manual creation. Lets the Add-Device dialog
13656
+ * pick the right type instead of assuming Camera.
13657
+ */
13658
+ getManualCreationType: method(object({}), object({ deviceType: _enum(DeviceType).nullable() })),
13633
13659
  adoptDiscoveredDevice: method(object({ candidate: DiscoveryCandidateSchema }), DeviceSummarySchema, {
13634
13660
  kind: "mutation",
13635
13661
  auth: "admin"
@@ -13753,9 +13779,23 @@ var BaseDeviceProvider = class extends BaseAddon {
13753
13779
  async supportsDiscovery() {
13754
13780
  return false;
13755
13781
  }
13756
- async discoverDevices() {
13782
+ async discoverDevices(_input) {
13757
13783
  return [];
13758
13784
  }
13785
+ /** Extra per-scan input form (e.g. a broadcast address for another subnet).
13786
+ * Null = no extra params. Override in providers that support scoped scans. */
13787
+ async getDiscoveryParamsSchema() {
13788
+ return null;
13789
+ }
13790
+ /**
13791
+ * The DeviceType this provider creates via manual add — derived from the
13792
+ * `deviceClasses` map (first registered type). `null` when manual creation is
13793
+ * unsupported. Lets the Add-Device dialog pick the right type per provider.
13794
+ */
13795
+ async getManualCreationType() {
13796
+ if (!await this.supportsManualCreation()) return { deviceType: null };
13797
+ return { deviceType: Object.values(DeviceType).find((t) => this.deviceClasses[t] !== void 0) ?? null };
13798
+ }
13759
13799
  async adoptDiscoveredDevice(_input) {
13760
13800
  throw new Error(`${this.providerName} provider does not support discovery-based adoption`);
13761
13801
  }
@@ -15617,7 +15657,10 @@ method(object({
15617
15657
  }), FieldProbeResultSchema, {
15618
15658
  kind: "mutation",
15619
15659
  auth: "admin"
15620
- }), method(ListCandidatesInputSchema.extend({ addonId: string() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15660
+ }), method(object({
15661
+ addonId: string(),
15662
+ integrationId: string()
15663
+ }), object({ filters: array(AdoptionFilterSchema) }), { auth: "admin" }), method(ListCandidatesInputSchema.extend({ addonId: string() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15621
15664
  addonId: string(),
15622
15665
  integrationId: string()
15623
15666
  }), AdoptionStatusSchema, {
@@ -15632,7 +15675,24 @@ method(object({
15632
15675
  }), method(ResyncInputSchema, ResyncResultSchema, {
15633
15676
  kind: "mutation",
15634
15677
  auth: "admin"
15678
+ }), method(object({}), object({ providers: array(object({
15679
+ addonId: string(),
15680
+ label: string()
15681
+ })).readonly() }), { auth: "admin" }), method(object({}), object({ groups: array(object({
15682
+ addonId: string(),
15683
+ label: string(),
15684
+ candidates: array(DiscoveryCandidateSchema).readonly(),
15685
+ error: string().nullable()
15686
+ })).readonly() }), {
15687
+ kind: "mutation",
15688
+ auth: "admin"
15635
15689
  }), method(object({
15690
+ addonId: string(),
15691
+ params: record(string(), unknown()).optional()
15692
+ }), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
15693
+ kind: "mutation",
15694
+ auth: "admin"
15695
+ }), method(object({ addonId: string() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string() }), unknown(), { auth: "admin" }), method(object({
15636
15696
  deviceId: number(),
15637
15697
  key: string(),
15638
15698
  value: unknown()
@@ -20755,6 +20815,12 @@ Object.freeze({
20755
20815
  addonId: null,
20756
20816
  access: "create"
20757
20817
  },
20818
+ "deviceManager.adoptionListCandidateFilters": {
20819
+ capName: "device-manager",
20820
+ capScope: "system",
20821
+ addonId: null,
20822
+ access: "view"
20823
+ },
20758
20824
  "deviceManager.adoptionListCandidates": {
20759
20825
  capName: "device-manager",
20760
20826
  capScope: "system",
@@ -20803,12 +20869,30 @@ Object.freeze({
20803
20869
  addonId: null,
20804
20870
  access: "create"
20805
20871
  },
20872
+ "deviceManager.discoverAllProviders": {
20873
+ capName: "device-manager",
20874
+ capScope: "system",
20875
+ addonId: null,
20876
+ access: "create"
20877
+ },
20806
20878
  "deviceManager.discoverDevices": {
20807
20879
  capName: "device-manager",
20808
20880
  capScope: "system",
20809
20881
  addonId: null,
20810
20882
  access: "create"
20811
20883
  },
20884
+ "deviceManager.discoverProvider": {
20885
+ capName: "device-manager",
20886
+ capScope: "system",
20887
+ addonId: null,
20888
+ access: "create"
20889
+ },
20890
+ "deviceManager.discoveryProviders": {
20891
+ capName: "device-manager",
20892
+ capScope: "system",
20893
+ addonId: null,
20894
+ access: "view"
20895
+ },
20812
20896
  "deviceManager.enable": {
20813
20897
  capName: "device-manager",
20814
20898
  capScope: "system",
@@ -20959,6 +21043,18 @@ Object.freeze({
20959
21043
  addonId: null,
20960
21044
  access: "create"
20961
21045
  },
21046
+ "deviceManager.providerCreationType": {
21047
+ capName: "device-manager",
21048
+ capScope: "system",
21049
+ addonId: null,
21050
+ access: "view"
21051
+ },
21052
+ "deviceManager.providerDiscoveryParamsSchema": {
21053
+ capName: "device-manager",
21054
+ capScope: "system",
21055
+ addonId: null,
21056
+ access: "view"
21057
+ },
20962
21058
  "deviceManager.registerDevice": {
20963
21059
  capName: "device-manager",
20964
21060
  capScope: "system",
@@ -21175,6 +21271,18 @@ Object.freeze({
21175
21271
  addonId: null,
21176
21272
  access: "view"
21177
21273
  },
21274
+ "deviceProvider.getDiscoveryParamsSchema": {
21275
+ capName: "device-provider",
21276
+ capScope: "system",
21277
+ addonId: null,
21278
+ access: "view"
21279
+ },
21280
+ "deviceProvider.getManualCreationType": {
21281
+ capName: "device-provider",
21282
+ capScope: "system",
21283
+ addonId: null,
21284
+ access: "view"
21285
+ },
21178
21286
  "deviceProvider.getStatus": {
21179
21287
  capName: "device-provider",
21180
21288
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -4665,7 +4665,7 @@ function _instanceof(cls, params = {}) {
4665
4665
  return inst;
4666
4666
  }
4667
4667
  //#endregion
4668
- //#region ../types/dist/sleep-B3AOslwX.mjs
4668
+ //#region ../types/dist/sleep-C2M2zF7x.mjs
4669
4669
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4670
4670
  EventCategory["SystemBoot"] = "system.boot";
4671
4671
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -6233,6 +6233,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6233
6233
  DeviceType["Switch"] = "switch";
6234
6234
  DeviceType["Sensor"] = "sensor";
6235
6235
  DeviceType["Thermostat"] = "thermostat";
6236
+ /** Air-conditioner / heat-pump climate device (HVAC) — shares the
6237
+ * `climate-control` cap surface with `Thermostat` but renders a
6238
+ * dedicated AC-appropriate control UI (mode chips, fan speed,
6239
+ * independent vertical/horizontal swing). Sources: native Gree, and
6240
+ * reusable by other AC integrations. */
6241
+ DeviceType["Climate"] = "climate";
6236
6242
  DeviceType["Button"] = "button";
6237
6243
  /** Generic stateless event emitter — carries a device's EXACT declared
6238
6244
  * event vocabulary verbatim (no normalization). Installed with the
@@ -9028,7 +9034,7 @@ var climateControlCapability = {
9028
9034
  scope: "device",
9029
9035
  deviceNative: true,
9030
9036
  mode: "singleton",
9031
- deviceTypes: [DeviceType.Thermostat],
9037
+ deviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
9032
9038
  methods: {
9033
9039
  setMode: method(object({
9034
9040
  deviceId: number().int().nonnegative(),
@@ -13627,10 +13633,30 @@ var deviceProviderCapability = {
13627
13633
  type: string()
13628
13634
  }))),
13629
13635
  supportsDiscovery: method(object({}), boolean()),
13630
- discoverDevices: method(object({}), array(DiscoveryCandidateSchema), {
13636
+ /**
13637
+ * Run a network scan. `params` carries optional provider-specific scan
13638
+ * inputs (e.g. a broadcast address / subnet for cross-subnet discovery),
13639
+ * shaped by `getDiscoveryParamsSchema`. Omitted for the generic scan
13640
+ * (provider uses its local-network default).
13641
+ */
13642
+ discoverDevices: method(object({ params: record(string(), unknown()).optional() }), array(DiscoveryCandidateSchema), {
13631
13643
  kind: "mutation",
13632
13644
  auth: "admin"
13633
13645
  }),
13646
+ /**
13647
+ * Optional form schema (`ConfigUISchema`) for the EXTRA per-scan inputs a
13648
+ * provider accepts (e.g. Gree's broadcast address for a different subnet).
13649
+ * `null` when the provider takes no extra scan params — the generic
13650
+ * aggregated scan never renders this; the per-integration scan does.
13651
+ */
13652
+ getDiscoveryParamsSchema: method(object({}), CreationSchemaOutputSchema),
13653
+ /**
13654
+ * The DeviceType this provider creates via manual add (Camera for
13655
+ * Reolink/ONVIF, Container for Gree, Hub for Ecowitt). `null` when the
13656
+ * provider does not support manual creation. Lets the Add-Device dialog
13657
+ * pick the right type instead of assuming Camera.
13658
+ */
13659
+ getManualCreationType: method(object({}), object({ deviceType: _enum(DeviceType).nullable() })),
13634
13660
  adoptDiscoveredDevice: method(object({ candidate: DiscoveryCandidateSchema }), DeviceSummarySchema, {
13635
13661
  kind: "mutation",
13636
13662
  auth: "admin"
@@ -13754,9 +13780,23 @@ var BaseDeviceProvider = class extends BaseAddon {
13754
13780
  async supportsDiscovery() {
13755
13781
  return false;
13756
13782
  }
13757
- async discoverDevices() {
13783
+ async discoverDevices(_input) {
13758
13784
  return [];
13759
13785
  }
13786
+ /** Extra per-scan input form (e.g. a broadcast address for another subnet).
13787
+ * Null = no extra params. Override in providers that support scoped scans. */
13788
+ async getDiscoveryParamsSchema() {
13789
+ return null;
13790
+ }
13791
+ /**
13792
+ * The DeviceType this provider creates via manual add — derived from the
13793
+ * `deviceClasses` map (first registered type). `null` when manual creation is
13794
+ * unsupported. Lets the Add-Device dialog pick the right type per provider.
13795
+ */
13796
+ async getManualCreationType() {
13797
+ if (!await this.supportsManualCreation()) return { deviceType: null };
13798
+ return { deviceType: Object.values(DeviceType).find((t) => this.deviceClasses[t] !== void 0) ?? null };
13799
+ }
13760
13800
  async adoptDiscoveredDevice(_input) {
13761
13801
  throw new Error(`${this.providerName} provider does not support discovery-based adoption`);
13762
13802
  }
@@ -15618,7 +15658,10 @@ method(object({
15618
15658
  }), FieldProbeResultSchema, {
15619
15659
  kind: "mutation",
15620
15660
  auth: "admin"
15621
- }), method(ListCandidatesInputSchema.extend({ addonId: string() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15661
+ }), method(object({
15662
+ addonId: string(),
15663
+ integrationId: string()
15664
+ }), object({ filters: array(AdoptionFilterSchema) }), { auth: "admin" }), method(ListCandidatesInputSchema.extend({ addonId: string() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15622
15665
  addonId: string(),
15623
15666
  integrationId: string()
15624
15667
  }), AdoptionStatusSchema, {
@@ -15633,7 +15676,24 @@ method(object({
15633
15676
  }), method(ResyncInputSchema, ResyncResultSchema, {
15634
15677
  kind: "mutation",
15635
15678
  auth: "admin"
15679
+ }), method(object({}), object({ providers: array(object({
15680
+ addonId: string(),
15681
+ label: string()
15682
+ })).readonly() }), { auth: "admin" }), method(object({}), object({ groups: array(object({
15683
+ addonId: string(),
15684
+ label: string(),
15685
+ candidates: array(DiscoveryCandidateSchema).readonly(),
15686
+ error: string().nullable()
15687
+ })).readonly() }), {
15688
+ kind: "mutation",
15689
+ auth: "admin"
15636
15690
  }), method(object({
15691
+ addonId: string(),
15692
+ params: record(string(), unknown()).optional()
15693
+ }), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
15694
+ kind: "mutation",
15695
+ auth: "admin"
15696
+ }), method(object({ addonId: string() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string() }), unknown(), { auth: "admin" }), method(object({
15637
15697
  deviceId: number(),
15638
15698
  key: string(),
15639
15699
  value: unknown()
@@ -20756,6 +20816,12 @@ Object.freeze({
20756
20816
  addonId: null,
20757
20817
  access: "create"
20758
20818
  },
20819
+ "deviceManager.adoptionListCandidateFilters": {
20820
+ capName: "device-manager",
20821
+ capScope: "system",
20822
+ addonId: null,
20823
+ access: "view"
20824
+ },
20759
20825
  "deviceManager.adoptionListCandidates": {
20760
20826
  capName: "device-manager",
20761
20827
  capScope: "system",
@@ -20804,12 +20870,30 @@ Object.freeze({
20804
20870
  addonId: null,
20805
20871
  access: "create"
20806
20872
  },
20873
+ "deviceManager.discoverAllProviders": {
20874
+ capName: "device-manager",
20875
+ capScope: "system",
20876
+ addonId: null,
20877
+ access: "create"
20878
+ },
20807
20879
  "deviceManager.discoverDevices": {
20808
20880
  capName: "device-manager",
20809
20881
  capScope: "system",
20810
20882
  addonId: null,
20811
20883
  access: "create"
20812
20884
  },
20885
+ "deviceManager.discoverProvider": {
20886
+ capName: "device-manager",
20887
+ capScope: "system",
20888
+ addonId: null,
20889
+ access: "create"
20890
+ },
20891
+ "deviceManager.discoveryProviders": {
20892
+ capName: "device-manager",
20893
+ capScope: "system",
20894
+ addonId: null,
20895
+ access: "view"
20896
+ },
20813
20897
  "deviceManager.enable": {
20814
20898
  capName: "device-manager",
20815
20899
  capScope: "system",
@@ -20960,6 +21044,18 @@ Object.freeze({
20960
21044
  addonId: null,
20961
21045
  access: "create"
20962
21046
  },
21047
+ "deviceManager.providerCreationType": {
21048
+ capName: "device-manager",
21049
+ capScope: "system",
21050
+ addonId: null,
21051
+ access: "view"
21052
+ },
21053
+ "deviceManager.providerDiscoveryParamsSchema": {
21054
+ capName: "device-manager",
21055
+ capScope: "system",
21056
+ addonId: null,
21057
+ access: "view"
21058
+ },
20963
21059
  "deviceManager.registerDevice": {
20964
21060
  capName: "device-manager",
20965
21061
  capScope: "system",
@@ -21176,6 +21272,18 @@ Object.freeze({
21176
21272
  addonId: null,
21177
21273
  access: "view"
21178
21274
  },
21275
+ "deviceProvider.getDiscoveryParamsSchema": {
21276
+ capName: "device-provider",
21277
+ capScope: "system",
21278
+ addonId: null,
21279
+ access: "view"
21280
+ },
21281
+ "deviceProvider.getManualCreationType": {
21282
+ capName: "device-provider",
21283
+ capScope: "system",
21284
+ addonId: null,
21285
+ access: "view"
21286
+ },
21179
21287
  "deviceProvider.getStatus": {
21180
21288
  capName: "device-provider",
21181
21289
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-dreo",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Dreo smart-device (fan / air-circulator / purifier / heater / humidifier) device-provider addon for CamStack — wraps the @apocaliss92/nodedreo Dreo cloud client (REST + WebSocket)",
5
5
  "keywords": [
6
6
  "camstack",