@digital-alchemy/hass 25.10.21-beta.0 → 25.10.26-beta.0
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/dev/mappings.d.mts +13 -7
- package/dist/dev/registry.d.mts +238 -0
- package/dist/hass.module.d.mts +5 -1
- package/dist/hass.module.mjs +5 -1
- package/dist/hass.module.mjs.map +1 -1
- package/dist/helpers/fetch/service-list.d.mts +15 -4
- package/dist/helpers/index.d.mts +1 -0
- package/dist/helpers/index.mjs +1 -0
- package/dist/helpers/index.mjs.map +1 -1
- package/dist/helpers/supported-features.d.mts +447 -0
- package/dist/helpers/supported-features.mjs +290 -0
- package/dist/helpers/supported-features.mjs.map +1 -0
- package/dist/mock_assistant/mock-assistant.module.d.mts +2 -0
- package/dist/services/feature.service.d.mts +10 -0
- package/dist/services/feature.service.mjs +95 -0
- package/dist/services/feature.service.mjs.map +1 -0
- package/dist/services/index.d.mts +1 -0
- package/dist/services/index.mjs +1 -0
- package/dist/services/index.mjs.map +1 -1
- package/dist/testing/feature.spec.d.mts +1 -0
- package/dist/testing/feature.spec.mjs +203 -0
- package/dist/testing/feature.spec.mjs.map +1 -0
- package/dist/testing/id-by.spec.mjs +3 -3
- package/dist/testing/id-by.spec.mjs.map +1 -1
- package/dist/testing/ref-by.spec.mjs +2 -2
- package/dist/testing/ref-by.spec.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dev/mappings.mts +38 -7
- package/src/dev/registry.mts +232 -0
- package/src/hass.module.mts +6 -0
- package/src/helpers/fetch/service-list.mts +13 -5
- package/src/helpers/index.mts +1 -0
- package/src/helpers/supported-features.mts +328 -0
- package/src/services/feature.service.mts +127 -0
- package/src/services/index.mts +1 -0
- package/src/testing/feature.spec.mts +219 -0
- package/src/testing/id-by.spec.mts +3 -3
- package/src/testing/ref-by.spec.mts +2 -2
package/dist/dev/mappings.d.mts
CHANGED
|
@@ -28,30 +28,36 @@ declare module "../user.mts" {
|
|
|
28
28
|
select_example_unique_id: "select.example";
|
|
29
29
|
text_example_unique_id: "text.example";
|
|
30
30
|
time_example_unique_id: "time.example";
|
|
31
|
+
light_test_light_unique_id: "light.test_light";
|
|
32
|
+
todo_test_todo_unique_id: "todo.test_todo";
|
|
33
|
+
climate_test_climate_unique_id: "climate.test_climate";
|
|
34
|
+
unsupported_test_unique_id: "unsupported.test";
|
|
31
35
|
}
|
|
32
36
|
interface HassZoneMapping {
|
|
33
37
|
test: true;
|
|
34
38
|
}
|
|
35
39
|
interface HassDomainMapping {
|
|
36
40
|
automation: "automation.example";
|
|
37
|
-
binary_sensor: "binary_sensor.hass_e2e_online" | "binary_sensor.toggles";
|
|
41
|
+
binary_sensor: "binary_sensor.bedroom_window" | "binary_sensor.garage_door" | "binary_sensor.hass_e2e_online" | "binary_sensor.toggles";
|
|
38
42
|
button: "button.example";
|
|
39
43
|
calendar: "calendar.united_states_tx";
|
|
44
|
+
climate: "climate.hallway_thermostat" | "climate.test_room" | "climate.test_climate";
|
|
40
45
|
date: "date.example";
|
|
41
46
|
datetime: "datetime.example";
|
|
42
|
-
light: "light.bedroom_ceiling_fan";
|
|
47
|
+
light: "light.bedroom_ceiling_fan" | "light.bedroom_light" | "light.kitchen_lamp" | "light.test_light";
|
|
43
48
|
lock: "lock.example";
|
|
44
49
|
number: "number.example";
|
|
45
50
|
person: "person.digital_alchemy";
|
|
46
51
|
scene: "scene.games_room_auto";
|
|
47
52
|
select: "select.example";
|
|
48
|
-
sensor: "sensor.magic" | "sensor.sun_next_dawn" | "sensor.sun_next_dusk" | "sensor.sun_next_midnight" | "sensor.sun_next_noon" | "sensor.sun_next_rising" | "sensor.sun_next_setting";
|
|
53
|
+
sensor: "sensor.bedroom_disabled_temp" | "sensor.floor_test_disabled" | "sensor.kitchen_disabled_temp" | "sensor.label_test_disabled" | "sensor.living_room_disabled_temp" | "sensor.living_room_temperature" | "sensor.magic" | "sensor.sun_next_dawn" | "sensor.sun_next_dusk" | "sensor.sun_next_midnight" | "sensor.sun_next_noon" | "sensor.sun_next_rising" | "sensor.sun_next_setting" | "sensor.sun_solar_azimuth" | "sensor.sun_solar_elevation" | "sensor.sun_solar_rising";
|
|
49
54
|
sun: "sun.sun";
|
|
50
55
|
switch: "switch.bedroom_lamp" | "switch.kitchen_cabinets" | "switch.living_room_mood_lights" | "switch.porch_light";
|
|
51
56
|
text: "text.example";
|
|
52
57
|
time: "time.example";
|
|
53
|
-
todo: "todo.shopping_list";
|
|
58
|
+
todo: "todo.shopping_list" | "todo.test_todo";
|
|
54
59
|
tts: "tts.google_en_com";
|
|
60
|
+
unsupported: "unsupported.test";
|
|
55
61
|
zone: "zone.home";
|
|
56
62
|
}
|
|
57
63
|
interface HassPlatformMapping {
|
|
@@ -59,7 +65,7 @@ declare module "../user.mts" {
|
|
|
59
65
|
_person: "person.digital_alchemy";
|
|
60
66
|
_shopping_list: "todo.shopping_list";
|
|
61
67
|
_google_translate: "tts.google_en_com";
|
|
62
|
-
_synapse: "binary_sensor.hass_e2e_online" | "sensor.magic" | "button.example" | "binary_sensor.toggles" | "switch.bedroom_lamp" | "switch.kitchen_cabinets" | "switch.living_room_mood_lights" | "switch.porch_light";
|
|
68
|
+
_synapse: "binary_sensor.hass_e2e_online" | "sensor.magic" | "button.example" | "binary_sensor.toggles" | "switch.bedroom_lamp" | "switch.kitchen_cabinets" | "switch.living_room_mood_lights" | "switch.porch_light" | "light.test_light" | "todo.test_todo" | "climate.test_climate" | "unsupported.test";
|
|
63
69
|
_holiday: "calendar.united_states_tx";
|
|
64
70
|
}
|
|
65
71
|
interface HassDeviceMapping {
|
|
@@ -70,10 +76,10 @@ declare module "../user.mts" {
|
|
|
70
76
|
_test: "switch.living_room_mood_lights";
|
|
71
77
|
_living_room: "switch.living_room_mood_lights";
|
|
72
78
|
_kitchen: "switch.kitchen_cabinets";
|
|
73
|
-
_bedroom: "switch.bedroom_lamp" | "light.bedroom_ceiling_fan";
|
|
79
|
+
_bedroom: "switch.bedroom_lamp" | "light.bedroom_ceiling_fan" | "light.bedroom_light";
|
|
74
80
|
}
|
|
75
81
|
interface HassLabelMapping {
|
|
76
|
-
_synapse: "binary_sensor.hass_e2e_online" | "sensor.magic" | "binary_sensor.toggles" | "switch.bedroom_lamp" | "switch.kitchen_cabinets" | "switch.living_room_mood_lights" | "switch.porch_light";
|
|
82
|
+
_synapse: "binary_sensor.hass_e2e_online" | "sensor.magic" | "binary_sensor.toggles" | "switch.bedroom_lamp" | "switch.kitchen_cabinets" | "switch.living_room_mood_lights" | "switch.porch_light" | "light.test_light" | "todo.test_todo" | "climate.test_climate" | "unsupported.test";
|
|
77
83
|
_test: never;
|
|
78
84
|
}
|
|
79
85
|
interface HassFloorMapping {
|
package/dist/dev/registry.d.mts
CHANGED
|
@@ -390,6 +390,244 @@ declare module "../user.mts" {
|
|
|
390
390
|
entity_id: "zone.home";
|
|
391
391
|
state: "0";
|
|
392
392
|
};
|
|
393
|
+
"binary_sensor.bedroom_window": {
|
|
394
|
+
attributes: {
|
|
395
|
+
id: "digital_alchemy";
|
|
396
|
+
user_id: "4dd1cf7e93e94f3fbaf419501f9a3d59";
|
|
397
|
+
friendly_name: "Bedroom Window Sensor";
|
|
398
|
+
};
|
|
399
|
+
context: {
|
|
400
|
+
id: "01HWXTSCSBRKJ9T2KV1JNER5KQ";
|
|
401
|
+
parent_id: null;
|
|
402
|
+
user_id: null;
|
|
403
|
+
};
|
|
404
|
+
entity_id: "binary_sensor.bedroom_window";
|
|
405
|
+
state: "on";
|
|
406
|
+
};
|
|
407
|
+
"binary_sensor.garage_door": {
|
|
408
|
+
attributes: {
|
|
409
|
+
device_class: "door";
|
|
410
|
+
friendly_name: "Garage Door Sensor";
|
|
411
|
+
};
|
|
412
|
+
context: {
|
|
413
|
+
id: "05FGHIJKLMNO4PQR5STUV6789WX";
|
|
414
|
+
parent_id: null;
|
|
415
|
+
user_id: null;
|
|
416
|
+
};
|
|
417
|
+
entity_id: "binary_sensor.garage_door";
|
|
418
|
+
state: "off";
|
|
419
|
+
};
|
|
420
|
+
"climate.hallway_thermostat": {
|
|
421
|
+
attributes: {
|
|
422
|
+
current_temperature: 22;
|
|
423
|
+
target_temperature: 20;
|
|
424
|
+
hvac_mode: "cool";
|
|
425
|
+
friendly_name: "Hallway Thermostat";
|
|
426
|
+
supported_features: 1;
|
|
427
|
+
};
|
|
428
|
+
context: {
|
|
429
|
+
id: "04MNOPQRSTUV8WX9YZABCDE123";
|
|
430
|
+
parent_id: null;
|
|
431
|
+
user_id: null;
|
|
432
|
+
};
|
|
433
|
+
entity_id: "climate.hallway_thermostat";
|
|
434
|
+
state: "cool";
|
|
435
|
+
};
|
|
436
|
+
"climate.test_room": {
|
|
437
|
+
attributes: {
|
|
438
|
+
id: "digital_alchemy";
|
|
439
|
+
user_id: "4dd1cf7e93e94f3fbaf419501f9a3d59";
|
|
440
|
+
friendly_name: "Test Room Climate";
|
|
441
|
+
};
|
|
442
|
+
context: {
|
|
443
|
+
id: "01HWXTSCSBRKJ9T2KV1JNER5KQ";
|
|
444
|
+
parent_id: null;
|
|
445
|
+
user_id: null;
|
|
446
|
+
};
|
|
447
|
+
entity_id: "climate.test_room";
|
|
448
|
+
state: "cooling";
|
|
449
|
+
};
|
|
450
|
+
"light.bedroom_light": {
|
|
451
|
+
attributes: {
|
|
452
|
+
brightness: 255;
|
|
453
|
+
friendly_name: "Bedroom Light";
|
|
454
|
+
supported_features: 41;
|
|
455
|
+
};
|
|
456
|
+
context: {
|
|
457
|
+
id: "03UVWXYZABCDE123FGHI456JKL7";
|
|
458
|
+
parent_id: null;
|
|
459
|
+
user_id: null;
|
|
460
|
+
};
|
|
461
|
+
entity_id: "light.bedroom_light";
|
|
462
|
+
state: "on";
|
|
463
|
+
};
|
|
464
|
+
"light.kitchen_lamp": {
|
|
465
|
+
attributes: {
|
|
466
|
+
id: "digital_alchemy";
|
|
467
|
+
user_id: "4dd1cf7e93e94f3fbaf419501f9a3d59";
|
|
468
|
+
friendly_name: "Kitchen Lamp";
|
|
469
|
+
};
|
|
470
|
+
context: {
|
|
471
|
+
id: "01HWXTSCSBRKJ9T2KV1JNER5KQ";
|
|
472
|
+
parent_id: null;
|
|
473
|
+
user_id: null;
|
|
474
|
+
};
|
|
475
|
+
entity_id: "light.kitchen_lamp";
|
|
476
|
+
state: "off";
|
|
477
|
+
};
|
|
478
|
+
"sensor.bedroom_disabled_temp": {
|
|
479
|
+
attributes: {
|
|
480
|
+
id: "digital_alchemy";
|
|
481
|
+
user_id: "disabled_test_3";
|
|
482
|
+
friendly_name: "Bedroom Disabled Temp";
|
|
483
|
+
};
|
|
484
|
+
context: {
|
|
485
|
+
id: "ctx3";
|
|
486
|
+
parent_id: null;
|
|
487
|
+
user_id: null;
|
|
488
|
+
};
|
|
489
|
+
entity_id: "sensor.bedroom_disabled_temp";
|
|
490
|
+
state: "unknown";
|
|
491
|
+
};
|
|
492
|
+
"sensor.floor_test_disabled": {
|
|
493
|
+
attributes: {
|
|
494
|
+
id: "digital_alchemy";
|
|
495
|
+
user_id: "disabled_test_4";
|
|
496
|
+
friendly_name: "Floor Test Disabled";
|
|
497
|
+
};
|
|
498
|
+
context: {
|
|
499
|
+
id: "ctx4";
|
|
500
|
+
parent_id: null;
|
|
501
|
+
user_id: null;
|
|
502
|
+
};
|
|
503
|
+
entity_id: "sensor.floor_test_disabled";
|
|
504
|
+
state: "unknown";
|
|
505
|
+
};
|
|
506
|
+
"sensor.kitchen_disabled_temp": {
|
|
507
|
+
attributes: {
|
|
508
|
+
id: "digital_alchemy";
|
|
509
|
+
user_id: "disabled_test_2";
|
|
510
|
+
friendly_name: "Kitchen Disabled Temp";
|
|
511
|
+
};
|
|
512
|
+
context: {
|
|
513
|
+
id: "ctx2";
|
|
514
|
+
parent_id: null;
|
|
515
|
+
user_id: null;
|
|
516
|
+
};
|
|
517
|
+
entity_id: "sensor.kitchen_disabled_temp";
|
|
518
|
+
state: "unknown";
|
|
519
|
+
};
|
|
520
|
+
"sensor.label_test_disabled": {
|
|
521
|
+
attributes: {
|
|
522
|
+
id: "digital_alchemy";
|
|
523
|
+
user_id: "disabled_test_5";
|
|
524
|
+
friendly_name: "Label Test Disabled";
|
|
525
|
+
};
|
|
526
|
+
context: {
|
|
527
|
+
id: "ctx5";
|
|
528
|
+
parent_id: null;
|
|
529
|
+
user_id: null;
|
|
530
|
+
};
|
|
531
|
+
entity_id: "sensor.label_test_disabled";
|
|
532
|
+
state: "unknown";
|
|
533
|
+
};
|
|
534
|
+
"sensor.living_room_disabled_temp": {
|
|
535
|
+
attributes: {
|
|
536
|
+
id: "digital_alchemy";
|
|
537
|
+
user_id: "disabled_test_1";
|
|
538
|
+
friendly_name: "Living Room Disabled Temp";
|
|
539
|
+
};
|
|
540
|
+
context: {
|
|
541
|
+
id: "ctx1";
|
|
542
|
+
parent_id: null;
|
|
543
|
+
user_id: null;
|
|
544
|
+
};
|
|
545
|
+
entity_id: "sensor.living_room_disabled_temp";
|
|
546
|
+
state: "unknown";
|
|
547
|
+
};
|
|
548
|
+
"sensor.living_room_temperature": {
|
|
549
|
+
attributes: {
|
|
550
|
+
id: "digital_alchemy";
|
|
551
|
+
user_id: "4dd1cf7e93e94f3fbaf419501f9a3d59";
|
|
552
|
+
friendly_name: "Living Room Temperature";
|
|
553
|
+
};
|
|
554
|
+
context: {
|
|
555
|
+
id: "01HWXTSCSBRKJ9T2KV1JNER5KQ";
|
|
556
|
+
parent_id: null;
|
|
557
|
+
user_id: null;
|
|
558
|
+
};
|
|
559
|
+
entity_id: "sensor.living_room_temperature";
|
|
560
|
+
state: "unavailable";
|
|
561
|
+
};
|
|
562
|
+
"sensor.sun_solar_azimuth": {
|
|
563
|
+
attributes: {
|
|
564
|
+
device_class: "angle";
|
|
565
|
+
friendly_name: "Sun Solar azimuth";
|
|
566
|
+
unit_of_measurement: "°";
|
|
567
|
+
};
|
|
568
|
+
context: {
|
|
569
|
+
id: "01HWXTS8W2MMADKGWE4A5BMH51";
|
|
570
|
+
parent_id: null;
|
|
571
|
+
user_id: null;
|
|
572
|
+
};
|
|
573
|
+
entity_id: "sensor.sun_solar_azimuth";
|
|
574
|
+
state: "0.35";
|
|
575
|
+
};
|
|
576
|
+
"sensor.sun_solar_elevation": {
|
|
577
|
+
attributes: {
|
|
578
|
+
device_class: "angle";
|
|
579
|
+
friendly_name: "Sun Solar elevation";
|
|
580
|
+
unit_of_measurement: "°";
|
|
581
|
+
};
|
|
582
|
+
context: {
|
|
583
|
+
id: "01HWXTS8W1J2TDGMN7KKNWP8DV";
|
|
584
|
+
parent_id: null;
|
|
585
|
+
user_id: null;
|
|
586
|
+
};
|
|
587
|
+
entity_id: "sensor.sun_solar_elevation";
|
|
588
|
+
state: "-21.86";
|
|
589
|
+
};
|
|
590
|
+
"sensor.sun_solar_rising": {
|
|
591
|
+
attributes: {
|
|
592
|
+
device_class: "timestamp";
|
|
593
|
+
friendly_name: "Sun Solar rising";
|
|
594
|
+
};
|
|
595
|
+
context: {
|
|
596
|
+
id: "01HWXTS8W2MMADKGWE4A5BMH51";
|
|
597
|
+
parent_id: null;
|
|
598
|
+
user_id: null;
|
|
599
|
+
};
|
|
600
|
+
entity_id: "sensor.sun_solar_rising";
|
|
601
|
+
state: "2024-05-03T04:05:17+00:00";
|
|
602
|
+
};
|
|
603
|
+
"light.test_light": {
|
|
604
|
+
attributes: {
|
|
605
|
+
supported_features: 44;
|
|
606
|
+
};
|
|
607
|
+
entity_id: "light.test_light";
|
|
608
|
+
state: "on";
|
|
609
|
+
};
|
|
610
|
+
"todo.test_todo": {
|
|
611
|
+
attributes: {
|
|
612
|
+
supported_features: 15;
|
|
613
|
+
};
|
|
614
|
+
entity_id: "todo.test_todo";
|
|
615
|
+
state: "0";
|
|
616
|
+
};
|
|
617
|
+
"climate.test_climate": {
|
|
618
|
+
attributes: {
|
|
619
|
+
supported_features: 1;
|
|
620
|
+
};
|
|
621
|
+
entity_id: "climate.test_climate";
|
|
622
|
+
state: "cool";
|
|
623
|
+
};
|
|
624
|
+
"unsupported.test": {
|
|
625
|
+
attributes: {
|
|
626
|
+
supported_features: 1;
|
|
627
|
+
};
|
|
628
|
+
entity_id: "unsupported.test";
|
|
629
|
+
state: "on";
|
|
630
|
+
};
|
|
393
631
|
}
|
|
394
632
|
}
|
|
395
633
|
export {};
|
package/dist/hass.module.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Area, Backup, CallProxy, Configure, Device, EntityManager, EventsService, FetchAPI, FetchInternals, Floor, HassDiagnosticsService, IDByExtension, Label, ReferenceService, Registry, WebsocketAPI, Zone } from "./services/index.mts";
|
|
1
|
+
import { Area, Backup, CallProxy, Configure, Device, EntityManager, EventsService, FetchAPI, FetchInternals, Floor, HassDiagnosticsService, HassFeatureService, IDByExtension, Label, ReferenceService, Registry, WebsocketAPI, Zone } from "./services/index.mts";
|
|
2
2
|
export declare const LIB_HASS: import("@digital-alchemy/core").LibraryDefinition<{
|
|
3
3
|
/**
|
|
4
4
|
* home assistant areas
|
|
@@ -32,6 +32,10 @@ export declare const LIB_HASS: import("@digital-alchemy/core").LibraryDefinition
|
|
|
32
32
|
* named event attachments
|
|
33
33
|
*/
|
|
34
34
|
events: typeof EventsService;
|
|
35
|
+
/**
|
|
36
|
+
* feature flag checking for entities
|
|
37
|
+
*/
|
|
38
|
+
feature: typeof HassFeatureService;
|
|
35
39
|
/**
|
|
36
40
|
* rest api commands
|
|
37
41
|
*/
|
package/dist/hass.module.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CreateLibrary } from "@digital-alchemy/core";
|
|
2
|
-
import { Area, Backup, CallProxy, Configure, Device, EntityManager, EventsService, FetchAPI, FetchInternals, Floor, HassDiagnosticsService, IDByExtension, Label, ReferenceService, Registry, WebsocketAPI, Zone, } from "./services/index.mjs";
|
|
2
|
+
import { Area, Backup, CallProxy, Configure, Device, EntityManager, EventsService, FetchAPI, FetchInternals, Floor, HassDiagnosticsService, HassFeatureService, IDByExtension, Label, ReferenceService, Registry, WebsocketAPI, Zone, } from "./services/index.mjs";
|
|
3
3
|
export const LIB_HASS = CreateLibrary({
|
|
4
4
|
configuration: {
|
|
5
5
|
/**
|
|
@@ -147,6 +147,10 @@ export const LIB_HASS = CreateLibrary({
|
|
|
147
147
|
* named event attachments
|
|
148
148
|
*/
|
|
149
149
|
events: EventsService,
|
|
150
|
+
/**
|
|
151
|
+
* feature flag checking for entities
|
|
152
|
+
*/
|
|
153
|
+
feature: HassFeatureService,
|
|
150
154
|
/**
|
|
151
155
|
* rest api commands
|
|
152
156
|
*/
|
package/dist/hass.module.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hass.module.mjs","sourceRoot":"","sources":["../src/hass.module.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,SAAS,EACT,MAAM,EACN,aAAa,EACb,aAAa,EACb,QAAQ,EACR,cAAc,EACd,KAAK,EACL,sBAAsB,EACtB,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,IAAI,GACL,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAC;IACpC,aAAa,EAAE;QACb;;;;WAIG;QACH,QAAQ,EAAE;YACR,OAAO,EAAE,iCAAiC;YAC1C,WAAW,EAAE,gCAAgC;YAC7C,IAAI,EAAE,QAAQ;SACf;QAED;;WAEG;QACH,gBAAgB,EAAE;YAChB,OAAO,EAAE,KAAK;YACd,WAAW,EAAE;gBACX,6CAA6C;gBAC7C,6DAA6D;aAC9D;YACD,IAAI,EAAE,SAAS;SAChB;QAED;;;;;WAKG;QACH,iBAAiB,EAAE;YACjB,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,QAAQ;SACf;QAED;;;;;;WAMG;QACH,qBAAqB,EAAE;YACrB,OAAO,EAAE,CAAC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MAAM,EAAE,aAAa;QAErB;;WAEG;QACH,MAAM,EAAE,aAAa;QAErB;;WAEG;QACH,OAAO,EAAE,kBAAkB;QAE3B;;WAEG;QACH,KAAK,EAAE,QAAQ;QAEf;;WAEG;QACH,KAAK,EAAE,KAAK;QAEZ;;WAEG;QACH,IAAI,EAAE,aAAa;QAEnB;;WAEG;QACH,SAAS,EAAE,cAAc;QAEzB;;WAEG;QACH,KAAK,EAAE,KAAK;QAEZ;;WAEG;QACH,KAAK,EAAE,gBAAgB;QAEvB;;WAEG;QACH,QAAQ,EAAE,QAAQ;QAElB;;WAEG;QACH,MAAM,EAAE,YAAY;QAEpB;;WAEG;QACH,IAAI,EAAE,IAAI;KACX;CACF,CAAC,CAAC"}
|
|
@@ -178,7 +178,7 @@ export interface ServiceListFilter {
|
|
|
178
178
|
supported_features?: number[];
|
|
179
179
|
supported_color_modes?: LiteralUnion<`${ColorMode}`, string>[];
|
|
180
180
|
}
|
|
181
|
-
export interface ServiceListFieldDescription {
|
|
181
|
+
export interface ServiceListFieldDescription<TYPE extends keyof ServiceListSelector = keyof ServiceListSelector> {
|
|
182
182
|
fields?: Record<string, ServiceListFieldDescription>;
|
|
183
183
|
target?: ServiceListServiceTarget;
|
|
184
184
|
response?: ResponseOptional;
|
|
@@ -189,11 +189,22 @@ export interface ServiceListFieldDescription {
|
|
|
189
189
|
filter?: ServiceListFilter;
|
|
190
190
|
name?: string;
|
|
191
191
|
required?: boolean;
|
|
192
|
-
|
|
192
|
+
/**
|
|
193
|
+
* The `selector` field is a discriminated union that ensures only one key of `ServiceListSelector`
|
|
194
|
+
* can be present at a time. This mapped type enforces mutual exclusivity at the type level,
|
|
195
|
+
* so that only a single selector type is allowed for each field description.
|
|
196
|
+
*/
|
|
197
|
+
selector?: {
|
|
198
|
+
[K in TYPE]: {
|
|
199
|
+
[P in K]: ServiceListSelector[P];
|
|
200
|
+
} & {
|
|
201
|
+
[P in Exclude<TYPE, K>]?: never;
|
|
202
|
+
};
|
|
203
|
+
}[TYPE];
|
|
193
204
|
}
|
|
194
205
|
export interface ServiceListServiceTarget {
|
|
195
|
-
entity?: EntityFilterSelector[];
|
|
196
|
-
device?: DeviceFilterSelector[];
|
|
206
|
+
entity?: EntityFilterSelector | EntityFilterSelector[];
|
|
207
|
+
device?: DeviceFilterSelector | DeviceFilterSelector[];
|
|
197
208
|
}
|
|
198
209
|
export interface ServiceListField {
|
|
199
210
|
description?: string;
|
package/dist/helpers/index.d.mts
CHANGED
package/dist/helpers/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./id-by.mjs";
|
|
|
9
9
|
export * from "./interfaces.mjs";
|
|
10
10
|
export * from "./notify.mjs";
|
|
11
11
|
export * from "./registry.mjs";
|
|
12
|
+
export * from "./supported-features.mjs";
|
|
12
13
|
export * from "./utility.mjs";
|
|
13
14
|
export * from "./websocket.mjs";
|
|
14
15
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/helpers/index.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/helpers/index.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|