@camstack/addon-import-alexa 0.1.7 → 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
@@ -4681,7 +4681,7 @@ function preprocess(fn, schema) {
4681
4681
  });
4682
4682
  }
4683
4683
  //#endregion
4684
- //#region ../types/dist/sleep-B3AOslwX.mjs
4684
+ //#region ../types/dist/sleep-C2M2zF7x.mjs
4685
4685
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4686
4686
  EventCategory["SystemBoot"] = "system.boot";
4687
4687
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -6249,6 +6249,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6249
6249
  DeviceType["Switch"] = "switch";
6250
6250
  DeviceType["Sensor"] = "sensor";
6251
6251
  DeviceType["Thermostat"] = "thermostat";
6252
+ /** Air-conditioner / heat-pump climate device (HVAC) — shares the
6253
+ * `climate-control` cap surface with `Thermostat` but renders a
6254
+ * dedicated AC-appropriate control UI (mode chips, fan speed,
6255
+ * independent vertical/horizontal swing). Sources: native Gree, and
6256
+ * reusable by other AC integrations. */
6257
+ DeviceType["Climate"] = "climate";
6252
6258
  DeviceType["Button"] = "button";
6253
6259
  /** Generic stateless event emitter — carries a device's EXACT declared
6254
6260
  * event vocabulary verbatim (no normalization). Installed with the
@@ -9161,7 +9167,7 @@ var climateControlCapability = {
9161
9167
  scope: "device",
9162
9168
  deviceNative: true,
9163
9169
  mode: "singleton",
9164
- deviceTypes: [DeviceType.Thermostat],
9170
+ deviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
9165
9171
  methods: {
9166
9172
  setMode: method(object({
9167
9173
  deviceId: number().int().nonnegative(),
@@ -13760,10 +13766,30 @@ var deviceProviderCapability = {
13760
13766
  type: string()
13761
13767
  }))),
13762
13768
  supportsDiscovery: method(object({}), boolean()),
13763
- discoverDevices: method(object({}), array(DiscoveryCandidateSchema), {
13769
+ /**
13770
+ * Run a network scan. `params` carries optional provider-specific scan
13771
+ * inputs (e.g. a broadcast address / subnet for cross-subnet discovery),
13772
+ * shaped by `getDiscoveryParamsSchema`. Omitted for the generic scan
13773
+ * (provider uses its local-network default).
13774
+ */
13775
+ discoverDevices: method(object({ params: record(string(), unknown()).optional() }), array(DiscoveryCandidateSchema), {
13764
13776
  kind: "mutation",
13765
13777
  auth: "admin"
13766
13778
  }),
13779
+ /**
13780
+ * Optional form schema (`ConfigUISchema`) for the EXTRA per-scan inputs a
13781
+ * provider accepts (e.g. Gree's broadcast address for a different subnet).
13782
+ * `null` when the provider takes no extra scan params — the generic
13783
+ * aggregated scan never renders this; the per-integration scan does.
13784
+ */
13785
+ getDiscoveryParamsSchema: method(object({}), CreationSchemaOutputSchema),
13786
+ /**
13787
+ * The DeviceType this provider creates via manual add (Camera for
13788
+ * Reolink/ONVIF, Container for Gree, Hub for Ecowitt). `null` when the
13789
+ * provider does not support manual creation. Lets the Add-Device dialog
13790
+ * pick the right type instead of assuming Camera.
13791
+ */
13792
+ getManualCreationType: method(object({}), object({ deviceType: _enum(DeviceType).nullable() })),
13767
13793
  adoptDiscoveredDevice: method(object({ candidate: DiscoveryCandidateSchema }), DeviceSummarySchema, {
13768
13794
  kind: "mutation",
13769
13795
  auth: "admin"
@@ -13887,9 +13913,23 @@ var BaseDeviceProvider = class extends BaseAddon {
13887
13913
  async supportsDiscovery() {
13888
13914
  return false;
13889
13915
  }
13890
- async discoverDevices() {
13916
+ async discoverDevices(_input) {
13891
13917
  return [];
13892
13918
  }
13919
+ /** Extra per-scan input form (e.g. a broadcast address for another subnet).
13920
+ * Null = no extra params. Override in providers that support scoped scans. */
13921
+ async getDiscoveryParamsSchema() {
13922
+ return null;
13923
+ }
13924
+ /**
13925
+ * The DeviceType this provider creates via manual add — derived from the
13926
+ * `deviceClasses` map (first registered type). `null` when manual creation is
13927
+ * unsupported. Lets the Add-Device dialog pick the right type per provider.
13928
+ */
13929
+ async getManualCreationType() {
13930
+ if (!await this.supportsManualCreation()) return { deviceType: null };
13931
+ return { deviceType: Object.values(DeviceType).find((t) => this.deviceClasses[t] !== void 0) ?? null };
13932
+ }
13893
13933
  async adoptDiscoveredDevice(_input) {
13894
13934
  throw new Error(`${this.providerName} provider does not support discovery-based adoption`);
13895
13935
  }
@@ -15819,7 +15859,10 @@ method(object({
15819
15859
  }), FieldProbeResultSchema, {
15820
15860
  kind: "mutation",
15821
15861
  auth: "admin"
15822
- }), method(ListCandidatesInputSchema.extend({ addonId: string() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15862
+ }), method(object({
15863
+ addonId: string(),
15864
+ integrationId: string()
15865
+ }), object({ filters: array(AdoptionFilterSchema) }), { auth: "admin" }), method(ListCandidatesInputSchema.extend({ addonId: string() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15823
15866
  addonId: string(),
15824
15867
  integrationId: string()
15825
15868
  }), AdoptionStatusSchema, {
@@ -15834,7 +15877,24 @@ method(object({
15834
15877
  }), method(ResyncInputSchema, ResyncResultSchema, {
15835
15878
  kind: "mutation",
15836
15879
  auth: "admin"
15880
+ }), method(object({}), object({ providers: array(object({
15881
+ addonId: string(),
15882
+ label: string()
15883
+ })).readonly() }), { auth: "admin" }), method(object({}), object({ groups: array(object({
15884
+ addonId: string(),
15885
+ label: string(),
15886
+ candidates: array(DiscoveryCandidateSchema).readonly(),
15887
+ error: string().nullable()
15888
+ })).readonly() }), {
15889
+ kind: "mutation",
15890
+ auth: "admin"
15837
15891
  }), method(object({
15892
+ addonId: string(),
15893
+ params: record(string(), unknown()).optional()
15894
+ }), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
15895
+ kind: "mutation",
15896
+ auth: "admin"
15897
+ }), method(object({ addonId: string() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string() }), unknown(), { auth: "admin" }), method(object({
15838
15898
  deviceId: number(),
15839
15899
  key: string(),
15840
15900
  value: unknown()
@@ -18503,6 +18563,17 @@ var AvailableIntegrationTypeSchema = object({
18503
18563
  iconUrl: string().nullable(),
18504
18564
  color: string(),
18505
18565
  instanceMode: string(),
18566
+ /**
18567
+ * Integration wizard `mode` (LOCKED MODEL): `standalone` (create
18568
+ * immediately then add devices, no config step/button), `account` (config
18569
+ * step), or `broker` (broker step). Derived server-side by
18570
+ * `getAvailableTypes` when the addon manifest omits an explicit `mode`.
18571
+ */
18572
+ mode: _enum([
18573
+ "standalone",
18574
+ "account",
18575
+ "broker"
18576
+ ]),
18506
18577
  discoveryMode: string(),
18507
18578
  /**
18508
18579
  * Which integration-marker cap the addon declared, so the wizard can
@@ -20963,6 +21034,12 @@ Object.freeze({
20963
21034
  addonId: null,
20964
21035
  access: "create"
20965
21036
  },
21037
+ "deviceManager.adoptionListCandidateFilters": {
21038
+ capName: "device-manager",
21039
+ capScope: "system",
21040
+ addonId: null,
21041
+ access: "view"
21042
+ },
20966
21043
  "deviceManager.adoptionListCandidates": {
20967
21044
  capName: "device-manager",
20968
21045
  capScope: "system",
@@ -21011,12 +21088,30 @@ Object.freeze({
21011
21088
  addonId: null,
21012
21089
  access: "create"
21013
21090
  },
21091
+ "deviceManager.discoverAllProviders": {
21092
+ capName: "device-manager",
21093
+ capScope: "system",
21094
+ addonId: null,
21095
+ access: "create"
21096
+ },
21014
21097
  "deviceManager.discoverDevices": {
21015
21098
  capName: "device-manager",
21016
21099
  capScope: "system",
21017
21100
  addonId: null,
21018
21101
  access: "create"
21019
21102
  },
21103
+ "deviceManager.discoverProvider": {
21104
+ capName: "device-manager",
21105
+ capScope: "system",
21106
+ addonId: null,
21107
+ access: "create"
21108
+ },
21109
+ "deviceManager.discoveryProviders": {
21110
+ capName: "device-manager",
21111
+ capScope: "system",
21112
+ addonId: null,
21113
+ access: "view"
21114
+ },
21020
21115
  "deviceManager.enable": {
21021
21116
  capName: "device-manager",
21022
21117
  capScope: "system",
@@ -21167,6 +21262,18 @@ Object.freeze({
21167
21262
  addonId: null,
21168
21263
  access: "create"
21169
21264
  },
21265
+ "deviceManager.providerCreationType": {
21266
+ capName: "device-manager",
21267
+ capScope: "system",
21268
+ addonId: null,
21269
+ access: "view"
21270
+ },
21271
+ "deviceManager.providerDiscoveryParamsSchema": {
21272
+ capName: "device-manager",
21273
+ capScope: "system",
21274
+ addonId: null,
21275
+ access: "view"
21276
+ },
21170
21277
  "deviceManager.registerDevice": {
21171
21278
  capName: "device-manager",
21172
21279
  capScope: "system",
@@ -21383,6 +21490,18 @@ Object.freeze({
21383
21490
  addonId: null,
21384
21491
  access: "view"
21385
21492
  },
21493
+ "deviceProvider.getDiscoveryParamsSchema": {
21494
+ capName: "device-provider",
21495
+ capScope: "system",
21496
+ addonId: null,
21497
+ access: "view"
21498
+ },
21499
+ "deviceProvider.getManualCreationType": {
21500
+ capName: "device-provider",
21501
+ capScope: "system",
21502
+ addonId: null,
21503
+ access: "view"
21504
+ },
21386
21505
  "deviceProvider.getStatus": {
21387
21506
  capName: "device-provider",
21388
21507
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -4681,7 +4681,7 @@ function preprocess(fn, schema) {
4681
4681
  });
4682
4682
  }
4683
4683
  //#endregion
4684
- //#region ../types/dist/sleep-B3AOslwX.mjs
4684
+ //#region ../types/dist/sleep-C2M2zF7x.mjs
4685
4685
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4686
4686
  EventCategory["SystemBoot"] = "system.boot";
4687
4687
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -6249,6 +6249,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6249
6249
  DeviceType["Switch"] = "switch";
6250
6250
  DeviceType["Sensor"] = "sensor";
6251
6251
  DeviceType["Thermostat"] = "thermostat";
6252
+ /** Air-conditioner / heat-pump climate device (HVAC) — shares the
6253
+ * `climate-control` cap surface with `Thermostat` but renders a
6254
+ * dedicated AC-appropriate control UI (mode chips, fan speed,
6255
+ * independent vertical/horizontal swing). Sources: native Gree, and
6256
+ * reusable by other AC integrations. */
6257
+ DeviceType["Climate"] = "climate";
6252
6258
  DeviceType["Button"] = "button";
6253
6259
  /** Generic stateless event emitter — carries a device's EXACT declared
6254
6260
  * event vocabulary verbatim (no normalization). Installed with the
@@ -9161,7 +9167,7 @@ var climateControlCapability = {
9161
9167
  scope: "device",
9162
9168
  deviceNative: true,
9163
9169
  mode: "singleton",
9164
- deviceTypes: [DeviceType.Thermostat],
9170
+ deviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
9165
9171
  methods: {
9166
9172
  setMode: method(object({
9167
9173
  deviceId: number().int().nonnegative(),
@@ -13760,10 +13766,30 @@ var deviceProviderCapability = {
13760
13766
  type: string()
13761
13767
  }))),
13762
13768
  supportsDiscovery: method(object({}), boolean()),
13763
- discoverDevices: method(object({}), array(DiscoveryCandidateSchema), {
13769
+ /**
13770
+ * Run a network scan. `params` carries optional provider-specific scan
13771
+ * inputs (e.g. a broadcast address / subnet for cross-subnet discovery),
13772
+ * shaped by `getDiscoveryParamsSchema`. Omitted for the generic scan
13773
+ * (provider uses its local-network default).
13774
+ */
13775
+ discoverDevices: method(object({ params: record(string(), unknown()).optional() }), array(DiscoveryCandidateSchema), {
13764
13776
  kind: "mutation",
13765
13777
  auth: "admin"
13766
13778
  }),
13779
+ /**
13780
+ * Optional form schema (`ConfigUISchema`) for the EXTRA per-scan inputs a
13781
+ * provider accepts (e.g. Gree's broadcast address for a different subnet).
13782
+ * `null` when the provider takes no extra scan params — the generic
13783
+ * aggregated scan never renders this; the per-integration scan does.
13784
+ */
13785
+ getDiscoveryParamsSchema: method(object({}), CreationSchemaOutputSchema),
13786
+ /**
13787
+ * The DeviceType this provider creates via manual add (Camera for
13788
+ * Reolink/ONVIF, Container for Gree, Hub for Ecowitt). `null` when the
13789
+ * provider does not support manual creation. Lets the Add-Device dialog
13790
+ * pick the right type instead of assuming Camera.
13791
+ */
13792
+ getManualCreationType: method(object({}), object({ deviceType: _enum(DeviceType).nullable() })),
13767
13793
  adoptDiscoveredDevice: method(object({ candidate: DiscoveryCandidateSchema }), DeviceSummarySchema, {
13768
13794
  kind: "mutation",
13769
13795
  auth: "admin"
@@ -13887,9 +13913,23 @@ var BaseDeviceProvider = class extends BaseAddon {
13887
13913
  async supportsDiscovery() {
13888
13914
  return false;
13889
13915
  }
13890
- async discoverDevices() {
13916
+ async discoverDevices(_input) {
13891
13917
  return [];
13892
13918
  }
13919
+ /** Extra per-scan input form (e.g. a broadcast address for another subnet).
13920
+ * Null = no extra params. Override in providers that support scoped scans. */
13921
+ async getDiscoveryParamsSchema() {
13922
+ return null;
13923
+ }
13924
+ /**
13925
+ * The DeviceType this provider creates via manual add — derived from the
13926
+ * `deviceClasses` map (first registered type). `null` when manual creation is
13927
+ * unsupported. Lets the Add-Device dialog pick the right type per provider.
13928
+ */
13929
+ async getManualCreationType() {
13930
+ if (!await this.supportsManualCreation()) return { deviceType: null };
13931
+ return { deviceType: Object.values(DeviceType).find((t) => this.deviceClasses[t] !== void 0) ?? null };
13932
+ }
13893
13933
  async adoptDiscoveredDevice(_input) {
13894
13934
  throw new Error(`${this.providerName} provider does not support discovery-based adoption`);
13895
13935
  }
@@ -15819,7 +15859,10 @@ method(object({
15819
15859
  }), FieldProbeResultSchema, {
15820
15860
  kind: "mutation",
15821
15861
  auth: "admin"
15822
- }), method(ListCandidatesInputSchema.extend({ addonId: string() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15862
+ }), method(object({
15863
+ addonId: string(),
15864
+ integrationId: string()
15865
+ }), object({ filters: array(AdoptionFilterSchema) }), { auth: "admin" }), method(ListCandidatesInputSchema.extend({ addonId: string() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
15823
15866
  addonId: string(),
15824
15867
  integrationId: string()
15825
15868
  }), AdoptionStatusSchema, {
@@ -15834,7 +15877,24 @@ method(object({
15834
15877
  }), method(ResyncInputSchema, ResyncResultSchema, {
15835
15878
  kind: "mutation",
15836
15879
  auth: "admin"
15880
+ }), method(object({}), object({ providers: array(object({
15881
+ addonId: string(),
15882
+ label: string()
15883
+ })).readonly() }), { auth: "admin" }), method(object({}), object({ groups: array(object({
15884
+ addonId: string(),
15885
+ label: string(),
15886
+ candidates: array(DiscoveryCandidateSchema).readonly(),
15887
+ error: string().nullable()
15888
+ })).readonly() }), {
15889
+ kind: "mutation",
15890
+ auth: "admin"
15837
15891
  }), method(object({
15892
+ addonId: string(),
15893
+ params: record(string(), unknown()).optional()
15894
+ }), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
15895
+ kind: "mutation",
15896
+ auth: "admin"
15897
+ }), method(object({ addonId: string() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string() }), unknown(), { auth: "admin" }), method(object({
15838
15898
  deviceId: number(),
15839
15899
  key: string(),
15840
15900
  value: unknown()
@@ -18503,6 +18563,17 @@ var AvailableIntegrationTypeSchema = object({
18503
18563
  iconUrl: string().nullable(),
18504
18564
  color: string(),
18505
18565
  instanceMode: string(),
18566
+ /**
18567
+ * Integration wizard `mode` (LOCKED MODEL): `standalone` (create
18568
+ * immediately then add devices, no config step/button), `account` (config
18569
+ * step), or `broker` (broker step). Derived server-side by
18570
+ * `getAvailableTypes` when the addon manifest omits an explicit `mode`.
18571
+ */
18572
+ mode: _enum([
18573
+ "standalone",
18574
+ "account",
18575
+ "broker"
18576
+ ]),
18506
18577
  discoveryMode: string(),
18507
18578
  /**
18508
18579
  * Which integration-marker cap the addon declared, so the wizard can
@@ -20963,6 +21034,12 @@ Object.freeze({
20963
21034
  addonId: null,
20964
21035
  access: "create"
20965
21036
  },
21037
+ "deviceManager.adoptionListCandidateFilters": {
21038
+ capName: "device-manager",
21039
+ capScope: "system",
21040
+ addonId: null,
21041
+ access: "view"
21042
+ },
20966
21043
  "deviceManager.adoptionListCandidates": {
20967
21044
  capName: "device-manager",
20968
21045
  capScope: "system",
@@ -21011,12 +21088,30 @@ Object.freeze({
21011
21088
  addonId: null,
21012
21089
  access: "create"
21013
21090
  },
21091
+ "deviceManager.discoverAllProviders": {
21092
+ capName: "device-manager",
21093
+ capScope: "system",
21094
+ addonId: null,
21095
+ access: "create"
21096
+ },
21014
21097
  "deviceManager.discoverDevices": {
21015
21098
  capName: "device-manager",
21016
21099
  capScope: "system",
21017
21100
  addonId: null,
21018
21101
  access: "create"
21019
21102
  },
21103
+ "deviceManager.discoverProvider": {
21104
+ capName: "device-manager",
21105
+ capScope: "system",
21106
+ addonId: null,
21107
+ access: "create"
21108
+ },
21109
+ "deviceManager.discoveryProviders": {
21110
+ capName: "device-manager",
21111
+ capScope: "system",
21112
+ addonId: null,
21113
+ access: "view"
21114
+ },
21020
21115
  "deviceManager.enable": {
21021
21116
  capName: "device-manager",
21022
21117
  capScope: "system",
@@ -21167,6 +21262,18 @@ Object.freeze({
21167
21262
  addonId: null,
21168
21263
  access: "create"
21169
21264
  },
21265
+ "deviceManager.providerCreationType": {
21266
+ capName: "device-manager",
21267
+ capScope: "system",
21268
+ addonId: null,
21269
+ access: "view"
21270
+ },
21271
+ "deviceManager.providerDiscoveryParamsSchema": {
21272
+ capName: "device-manager",
21273
+ capScope: "system",
21274
+ addonId: null,
21275
+ access: "view"
21276
+ },
21170
21277
  "deviceManager.registerDevice": {
21171
21278
  capName: "device-manager",
21172
21279
  capScope: "system",
@@ -21383,6 +21490,18 @@ Object.freeze({
21383
21490
  addonId: null,
21384
21491
  access: "view"
21385
21492
  },
21493
+ "deviceProvider.getDiscoveryParamsSchema": {
21494
+ capName: "device-provider",
21495
+ capScope: "system",
21496
+ addonId: null,
21497
+ access: "view"
21498
+ },
21499
+ "deviceProvider.getManualCreationType": {
21500
+ capName: "device-provider",
21501
+ capScope: "system",
21502
+ addonId: null,
21503
+ access: "view"
21504
+ },
21386
21505
  "deviceProvider.getStatus": {
21387
21506
  capName: "device-provider",
21388
21507
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-import-alexa",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
5
5
  "keywords": [
6
6
  "camstack",