@camstack/addon-provider-reolink 1.2.252 → 1.2.254
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/CHANGELOG.md +22 -0
- package/dist/addon.js +1044 -163
- package/dist/addon.mjs +1044 -163
- package/i18n/en.json +8 -15
- package/i18n/it.json +8 -15
- package/package.json +2 -2
package/dist/addon.mjs
CHANGED
|
@@ -106813,7 +106813,7 @@ var ZodIssueCode = {
|
|
|
106813
106813
|
var ZodFirstPartyTypeKind;
|
|
106814
106814
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
106815
106815
|
//#endregion
|
|
106816
|
-
//#region ../types/dist/runtime-capabilities-
|
|
106816
|
+
//#region ../types/dist/runtime-capabilities-CK6y0W5U.mjs
|
|
106817
106817
|
/**
|
|
106818
106818
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
106819
106819
|
* window to float samples (D455).
|
|
@@ -124483,6 +124483,650 @@ Object.freeze({
|
|
|
124483
124483
|
}
|
|
124484
124484
|
]
|
|
124485
124485
|
});
|
|
124486
|
+
Object.freeze({
|
|
124487
|
+
"air-quality-sensor": {
|
|
124488
|
+
"aqi": "optional",
|
|
124489
|
+
"co2": "optional",
|
|
124490
|
+
"lastFetchedAt": "required",
|
|
124491
|
+
"pm10": "optional",
|
|
124492
|
+
"pm25": "optional",
|
|
124493
|
+
"voc": "optional"
|
|
124494
|
+
},
|
|
124495
|
+
"alarm-panel": {
|
|
124496
|
+
"availableModes": "required",
|
|
124497
|
+
"codeRequired": "required",
|
|
124498
|
+
"lastChangedAt": "required",
|
|
124499
|
+
"state": "required",
|
|
124500
|
+
"targetMode": "optional"
|
|
124501
|
+
},
|
|
124502
|
+
"ambient-light-sensor": {
|
|
124503
|
+
"illuminance": "required",
|
|
124504
|
+
"lastFetchedAt": "required"
|
|
124505
|
+
},
|
|
124506
|
+
"audio-metrics": {
|
|
124507
|
+
"avgDbfs": "required",
|
|
124508
|
+
"byClass": "required",
|
|
124509
|
+
"current": "required",
|
|
124510
|
+
"level": "required",
|
|
124511
|
+
"peakDbfs": "required",
|
|
124512
|
+
"ts": "required",
|
|
124513
|
+
"windowSec": "required"
|
|
124514
|
+
},
|
|
124515
|
+
"automation-control": {
|
|
124516
|
+
"enabled": "required",
|
|
124517
|
+
"isRunning": "required",
|
|
124518
|
+
"lastChangedAt": "required",
|
|
124519
|
+
"lastError": "required",
|
|
124520
|
+
"lastTriggeredAt": "required"
|
|
124521
|
+
},
|
|
124522
|
+
"battery": {
|
|
124523
|
+
"binary": "optional",
|
|
124524
|
+
"chargeState": "optional",
|
|
124525
|
+
"charging": "required",
|
|
124526
|
+
"currentMa": "optional",
|
|
124527
|
+
"lastContactAt": "optional",
|
|
124528
|
+
"lastFullRefreshAt": "optional",
|
|
124529
|
+
"lastUpdated": "required",
|
|
124530
|
+
"level": "required",
|
|
124531
|
+
"sleeping": "required",
|
|
124532
|
+
"temperatureC": "optional",
|
|
124533
|
+
"voltage": "optional"
|
|
124534
|
+
},
|
|
124535
|
+
"binary": {
|
|
124536
|
+
"lastChangedAt": "required",
|
|
124537
|
+
"on": "required"
|
|
124538
|
+
},
|
|
124539
|
+
"brightness": {
|
|
124540
|
+
"lastChangedAt": "required",
|
|
124541
|
+
"level": "required"
|
|
124542
|
+
},
|
|
124543
|
+
"camera-streams": {
|
|
124544
|
+
"lastChangedAt": "required",
|
|
124545
|
+
"online": "required",
|
|
124546
|
+
"slotErrors": "required",
|
|
124547
|
+
"slotStatuses": "required"
|
|
124548
|
+
},
|
|
124549
|
+
"carbon-monoxide": {
|
|
124550
|
+
"detected": "required",
|
|
124551
|
+
"lastChangedAt": "required"
|
|
124552
|
+
},
|
|
124553
|
+
"climate-control": {
|
|
124554
|
+
"action": "optional",
|
|
124555
|
+
"availableFanModes": "required",
|
|
124556
|
+
"availableModes": "required",
|
|
124557
|
+
"availablePresets": "required",
|
|
124558
|
+
"currentHumidity": "required",
|
|
124559
|
+
"currentTemp": "required",
|
|
124560
|
+
"fanMode": "required",
|
|
124561
|
+
"lastActiveMode": "optional",
|
|
124562
|
+
"lastFetchedAt": "required",
|
|
124563
|
+
"maxTemp": "optional",
|
|
124564
|
+
"minTemp": "optional",
|
|
124565
|
+
"mode": "required",
|
|
124566
|
+
"preset": "required",
|
|
124567
|
+
"swingHorizontal": "required",
|
|
124568
|
+
"swingVertical": "required",
|
|
124569
|
+
"target": "required",
|
|
124570
|
+
"targetHigh": "required",
|
|
124571
|
+
"targetHumidity": "required",
|
|
124572
|
+
"targetLow": "required",
|
|
124573
|
+
"tempStep": "optional"
|
|
124574
|
+
},
|
|
124575
|
+
"color": {
|
|
124576
|
+
"colorTemperature": "optional",
|
|
124577
|
+
"hsv": "optional",
|
|
124578
|
+
"lastChangedAt": "required",
|
|
124579
|
+
"mode": "required",
|
|
124580
|
+
"rgb": "optional"
|
|
124581
|
+
},
|
|
124582
|
+
"connectivity": {
|
|
124583
|
+
"connected": "required",
|
|
124584
|
+
"lastChangedAt": "required"
|
|
124585
|
+
},
|
|
124586
|
+
"consumables": {
|
|
124587
|
+
"items": "required",
|
|
124588
|
+
"lastChangedAt": "required",
|
|
124589
|
+
"lastFetchedAt": "required"
|
|
124590
|
+
},
|
|
124591
|
+
"contact": {
|
|
124592
|
+
"entryOpen": "required",
|
|
124593
|
+
"lastChangedAt": "required"
|
|
124594
|
+
},
|
|
124595
|
+
"control": {
|
|
124596
|
+
"kind": "required",
|
|
124597
|
+
"lastChangedAt": "required",
|
|
124598
|
+
"max": "optional",
|
|
124599
|
+
"min": "optional",
|
|
124600
|
+
"options": "required",
|
|
124601
|
+
"step": "optional",
|
|
124602
|
+
"value": "required"
|
|
124603
|
+
},
|
|
124604
|
+
"cover": {
|
|
124605
|
+
"lastChangedAt": "required",
|
|
124606
|
+
"position": "required",
|
|
124607
|
+
"state": "required",
|
|
124608
|
+
"tiltPosition": "required"
|
|
124609
|
+
},
|
|
124610
|
+
"day-night": {
|
|
124611
|
+
"lastFetchedAt": "required",
|
|
124612
|
+
"mode": "required",
|
|
124613
|
+
"sensitivity": "optional",
|
|
124614
|
+
"switchDelaySec": "optional"
|
|
124615
|
+
},
|
|
124616
|
+
"device-status": {
|
|
124617
|
+
"lastChangedAt": "required",
|
|
124618
|
+
"online": "required"
|
|
124619
|
+
},
|
|
124620
|
+
"dishwasher": {
|
|
124621
|
+
"activeEvents": "required",
|
|
124622
|
+
"availability": "required",
|
|
124623
|
+
"availablePrograms": "required",
|
|
124624
|
+
"childLock": "required",
|
|
124625
|
+
"delayedStart": "required",
|
|
124626
|
+
"doorLocked": "required",
|
|
124627
|
+
"doorOpen": "required",
|
|
124628
|
+
"errorCode": "required",
|
|
124629
|
+
"errorLabel": "required",
|
|
124630
|
+
"extraDry": "required",
|
|
124631
|
+
"filterCleaningDue": "required",
|
|
124632
|
+
"halfLoad": "required",
|
|
124633
|
+
"hygienePlus": "required",
|
|
124634
|
+
"intensiveZone": "required",
|
|
124635
|
+
"lastFetchedAt": "required",
|
|
124636
|
+
"localControlActive": "required",
|
|
124637
|
+
"machineCareDue": "required",
|
|
124638
|
+
"machineCareRemainingRuns": "required",
|
|
124639
|
+
"operationState": "required",
|
|
124640
|
+
"powerOn": "required",
|
|
124641
|
+
"powerState": "required",
|
|
124642
|
+
"program": "required",
|
|
124643
|
+
"progress": "required",
|
|
124644
|
+
"remaining": "required",
|
|
124645
|
+
"remoteControlActive": "required",
|
|
124646
|
+
"remoteStartAllowed": "required",
|
|
124647
|
+
"selectedProgram": "required",
|
|
124648
|
+
"state": "required",
|
|
124649
|
+
"varioSpeedPlus": "required"
|
|
124650
|
+
},
|
|
124651
|
+
"do-not-disturb": {
|
|
124652
|
+
"enabled": "required",
|
|
124653
|
+
"lastChangedAt": "required"
|
|
124654
|
+
},
|
|
124655
|
+
"doorbell": {
|
|
124656
|
+
"lastPressedAt": "required",
|
|
124657
|
+
"pressCountSinceStart": "required"
|
|
124658
|
+
},
|
|
124659
|
+
"energy-system": {
|
|
124660
|
+
"grid": "required",
|
|
124661
|
+
"heatPump": "required",
|
|
124662
|
+
"house": "required",
|
|
124663
|
+
"lastFetchedAt": "required",
|
|
124664
|
+
"solar": "required",
|
|
124665
|
+
"storage": "required"
|
|
124666
|
+
},
|
|
124667
|
+
"enum-sensor": {
|
|
124668
|
+
"lastFetchedAt": "required",
|
|
124669
|
+
"timestamp": "optional",
|
|
124670
|
+
"value": "required"
|
|
124671
|
+
},
|
|
124672
|
+
"error": {
|
|
124673
|
+
"active": "required",
|
|
124674
|
+
"code": "required",
|
|
124675
|
+
"faults": "optional",
|
|
124676
|
+
"label": "required",
|
|
124677
|
+
"lastFetchedAt": "required",
|
|
124678
|
+
"severity": "required",
|
|
124679
|
+
"since": "required"
|
|
124680
|
+
},
|
|
124681
|
+
"event-emitter": {
|
|
124682
|
+
"eventCountSinceStart": "required",
|
|
124683
|
+
"eventTypes": "required",
|
|
124684
|
+
"lastEvent": "required",
|
|
124685
|
+
"vocabulary": "optional"
|
|
124686
|
+
},
|
|
124687
|
+
"fan-control": {
|
|
124688
|
+
"availablePresets": "required",
|
|
124689
|
+
"direction": "required",
|
|
124690
|
+
"lastChangedAt": "required",
|
|
124691
|
+
"oscillating": "required",
|
|
124692
|
+
"oscillationAxes": "optional",
|
|
124693
|
+
"percentageStep": "optional",
|
|
124694
|
+
"preset": "required",
|
|
124695
|
+
"speed": "required"
|
|
124696
|
+
},
|
|
124697
|
+
"feature-probe": {
|
|
124698
|
+
"channelCount": "required",
|
|
124699
|
+
"deviceType": "required",
|
|
124700
|
+
"flags": "required",
|
|
124701
|
+
"lastFetchedAt": "required",
|
|
124702
|
+
"lastProbedAt": "required",
|
|
124703
|
+
"model": "required"
|
|
124704
|
+
},
|
|
124705
|
+
"flood": {
|
|
124706
|
+
"flooded": "required",
|
|
124707
|
+
"lastChangedAt": "required"
|
|
124708
|
+
},
|
|
124709
|
+
"gas": {
|
|
124710
|
+
"detected": "required",
|
|
124711
|
+
"lastChangedAt": "required"
|
|
124712
|
+
},
|
|
124713
|
+
"group-active": {
|
|
124714
|
+
"active": "required",
|
|
124715
|
+
"lastChangedAt": "required"
|
|
124716
|
+
},
|
|
124717
|
+
"group-commands": { "results": "required" },
|
|
124718
|
+
"group-status": {
|
|
124719
|
+
"excluded": "required",
|
|
124720
|
+
"included": "required",
|
|
124721
|
+
"total": "required"
|
|
124722
|
+
},
|
|
124723
|
+
"heat-pump-status": {
|
|
124724
|
+
"circuits": "required",
|
|
124725
|
+
"energy": "required",
|
|
124726
|
+
"lastFetchedAt": "required",
|
|
124727
|
+
"power": "required",
|
|
124728
|
+
"starts": "required",
|
|
124729
|
+
"system": "required",
|
|
124730
|
+
"temperatures": "required",
|
|
124731
|
+
"waterPressureBar": "required"
|
|
124732
|
+
},
|
|
124733
|
+
"heating-valve": {
|
|
124734
|
+
"lastFetchedAt": "required",
|
|
124735
|
+
"position": "required"
|
|
124736
|
+
},
|
|
124737
|
+
"humidifier": {
|
|
124738
|
+
"action": "required",
|
|
124739
|
+
"availableModes": "required",
|
|
124740
|
+
"currentHumidity": "required",
|
|
124741
|
+
"lastChangedAt": "required",
|
|
124742
|
+
"maxHumidity": "required",
|
|
124743
|
+
"minHumidity": "required",
|
|
124744
|
+
"mode": "required",
|
|
124745
|
+
"on": "required",
|
|
124746
|
+
"targetHumidity": "required"
|
|
124747
|
+
},
|
|
124748
|
+
"humidity-sensor": {
|
|
124749
|
+
"humidity": "required",
|
|
124750
|
+
"lastFetchedAt": "required"
|
|
124751
|
+
},
|
|
124752
|
+
"image": {
|
|
124753
|
+
"lastUpdated": "required",
|
|
124754
|
+
"url": "required"
|
|
124755
|
+
},
|
|
124756
|
+
"image-settings": {
|
|
124757
|
+
"backlightMode": "optional",
|
|
124758
|
+
"brightness": "optional",
|
|
124759
|
+
"contrast": "optional",
|
|
124760
|
+
"exposureMode": "optional",
|
|
124761
|
+
"flip": "optional",
|
|
124762
|
+
"lastFetchedAt": "required",
|
|
124763
|
+
"mirror": "optional",
|
|
124764
|
+
"rotate": "optional",
|
|
124765
|
+
"saturation": "optional",
|
|
124766
|
+
"sharpness": "optional",
|
|
124767
|
+
"warmth": "optional",
|
|
124768
|
+
"whiteBalance": "optional"
|
|
124769
|
+
},
|
|
124770
|
+
"intercom": {
|
|
124771
|
+
"ability": "required",
|
|
124772
|
+
"lastSessionAt": "required",
|
|
124773
|
+
"talking": "required"
|
|
124774
|
+
},
|
|
124775
|
+
"ir-transmitter": {
|
|
124776
|
+
"lastFetchedAt": "required",
|
|
124777
|
+
"lastLearn": "required",
|
|
124778
|
+
"lastSend": "required"
|
|
124779
|
+
},
|
|
124780
|
+
"lawn-mower-control": {
|
|
124781
|
+
"activity": "required",
|
|
124782
|
+
"batteryLevel": "required",
|
|
124783
|
+
"currentCode": "required",
|
|
124784
|
+
"currentCodeLabel": "required",
|
|
124785
|
+
"lastChangedAt": "required",
|
|
124786
|
+
"progress": "required",
|
|
124787
|
+
"severity": "required"
|
|
124788
|
+
},
|
|
124789
|
+
"lock-control": {
|
|
124790
|
+
"codeRequired": "optional",
|
|
124791
|
+
"lastChangedAt": "required",
|
|
124792
|
+
"state": "required"
|
|
124793
|
+
},
|
|
124794
|
+
"low-power-sleep": {
|
|
124795
|
+
"lastContactAt": "optional",
|
|
124796
|
+
"lastUpdated": "required",
|
|
124797
|
+
"sleeping": "required"
|
|
124798
|
+
},
|
|
124799
|
+
"media-player": {
|
|
124800
|
+
"assumedFields": "optional",
|
|
124801
|
+
"availableSources": "required",
|
|
124802
|
+
"currentMedia": "required",
|
|
124803
|
+
"declaredSources": "optional",
|
|
124804
|
+
"duration": "required",
|
|
124805
|
+
"isMuted": "required",
|
|
124806
|
+
"lastChangedAt": "required",
|
|
124807
|
+
"muteReadback": "optional",
|
|
124808
|
+
"position": "required",
|
|
124809
|
+
"positionUpdatedAt": "optional",
|
|
124810
|
+
"repeat": "required",
|
|
124811
|
+
"shuffle": "required",
|
|
124812
|
+
"source": "required",
|
|
124813
|
+
"state": "required",
|
|
124814
|
+
"stateSource": "optional",
|
|
124815
|
+
"volumeLevel": "required"
|
|
124816
|
+
},
|
|
124817
|
+
"meter": {
|
|
124818
|
+
"lastFetchedAt": "required",
|
|
124819
|
+
"value": "required"
|
|
124820
|
+
},
|
|
124821
|
+
"motion": {
|
|
124822
|
+
"autoClearAfterMs": "required",
|
|
124823
|
+
"detected": "required",
|
|
124824
|
+
"lastDetectedAt": "required"
|
|
124825
|
+
},
|
|
124826
|
+
"motion-trigger": {
|
|
124827
|
+
"enabled": "required",
|
|
124828
|
+
"lastChangedAt": "required",
|
|
124829
|
+
"lastFetchedAt": "required"
|
|
124830
|
+
},
|
|
124831
|
+
"motion-zones": {
|
|
124832
|
+
"enabled": "required",
|
|
124833
|
+
"lastFetchedAt": "required",
|
|
124834
|
+
"regions": "required",
|
|
124835
|
+
"sensitivity": "required"
|
|
124836
|
+
},
|
|
124837
|
+
"native-object-detection": {
|
|
124838
|
+
"enabled": "required",
|
|
124839
|
+
"lastByClass": "required",
|
|
124840
|
+
"lastFetchedAt": "required",
|
|
124841
|
+
"supportedClasses": "required"
|
|
124842
|
+
},
|
|
124843
|
+
"navigation": {
|
|
124844
|
+
"flash": "required",
|
|
124845
|
+
"following": "required",
|
|
124846
|
+
"lastChangedAt": "required",
|
|
124847
|
+
"lastFetchedAt": "required",
|
|
124848
|
+
"lightLevel": "required",
|
|
124849
|
+
"lightMode": "required",
|
|
124850
|
+
"mode": "required"
|
|
124851
|
+
},
|
|
124852
|
+
"network-link": {
|
|
124853
|
+
"lastUpdated": "required",
|
|
124854
|
+
"linkUp": "optional",
|
|
124855
|
+
"rssi": "optional",
|
|
124856
|
+
"signal": "required",
|
|
124857
|
+
"speedKbps": "optional",
|
|
124858
|
+
"ssid": "optional",
|
|
124859
|
+
"type": "required"
|
|
124860
|
+
},
|
|
124861
|
+
"notifier": {
|
|
124862
|
+
"lastError": "required",
|
|
124863
|
+
"lastSentAt": "required",
|
|
124864
|
+
"queueDepth": "required",
|
|
124865
|
+
"supports": "required"
|
|
124866
|
+
},
|
|
124867
|
+
"numeric-sensor": {
|
|
124868
|
+
"lastFetchedAt": "required",
|
|
124869
|
+
"value": "required"
|
|
124870
|
+
},
|
|
124871
|
+
"pet-feeder": {
|
|
124872
|
+
"batteryPower": "required",
|
|
124873
|
+
"bowlFood": "required",
|
|
124874
|
+
"childLock": "required",
|
|
124875
|
+
"desiccantLeftDays": "required",
|
|
124876
|
+
"eating": "required",
|
|
124877
|
+
"error": "required",
|
|
124878
|
+
"errorCode": "required",
|
|
124879
|
+
"feeding": "required",
|
|
124880
|
+
"feedSound": "required",
|
|
124881
|
+
"food1": "required",
|
|
124882
|
+
"food2": "required",
|
|
124883
|
+
"foodLevel": "required",
|
|
124884
|
+
"indicatorLight": "required",
|
|
124885
|
+
"isDualHopper": "required",
|
|
124886
|
+
"lastFeedGrams": "required",
|
|
124887
|
+
"lastFeedHopper1": "required",
|
|
124888
|
+
"lastFeedHopper2": "required",
|
|
124889
|
+
"lastFetchedAt": "required",
|
|
124890
|
+
"lowFood": "required",
|
|
124891
|
+
"powerSource": "required",
|
|
124892
|
+
"status": "required",
|
|
124893
|
+
"supportsMarkRefilled": "required",
|
|
124894
|
+
"volume": "required"
|
|
124895
|
+
},
|
|
124896
|
+
"pet-fountain": {
|
|
124897
|
+
"empty": "required",
|
|
124898
|
+
"error": "required",
|
|
124899
|
+
"lastFetchedAt": "required",
|
|
124900
|
+
"pumpRunning": "required",
|
|
124901
|
+
"waterLevel": "required",
|
|
124902
|
+
"waterVolume": "required"
|
|
124903
|
+
},
|
|
124904
|
+
"power-meter": {
|
|
124905
|
+
"apparentPower": "optional",
|
|
124906
|
+
"current": "optional",
|
|
124907
|
+
"deliveredPower": "optional",
|
|
124908
|
+
"energy": "optional",
|
|
124909
|
+
"lastFetchedAt": "required",
|
|
124910
|
+
"power": "optional",
|
|
124911
|
+
"powerFactor": "optional",
|
|
124912
|
+
"voltage": "optional"
|
|
124913
|
+
},
|
|
124914
|
+
"power-source": {
|
|
124915
|
+
"lastFetchedAt": "required",
|
|
124916
|
+
"offSeconds": "required",
|
|
124917
|
+
"switchOn": "required"
|
|
124918
|
+
},
|
|
124919
|
+
"presence": {
|
|
124920
|
+
"gps": "required",
|
|
124921
|
+
"lastChangedAt": "required",
|
|
124922
|
+
"location": "required",
|
|
124923
|
+
"state": "required"
|
|
124924
|
+
},
|
|
124925
|
+
"pressure-sensor": {
|
|
124926
|
+
"lastFetchedAt": "required",
|
|
124927
|
+
"pressure": "required"
|
|
124928
|
+
},
|
|
124929
|
+
"privacy-mask": {
|
|
124930
|
+
"audioEnabled": "required",
|
|
124931
|
+
"enabled": "required",
|
|
124932
|
+
"lastFetchedAt": "required",
|
|
124933
|
+
"regions": "required"
|
|
124934
|
+
},
|
|
124935
|
+
"ptz-autotrack": {
|
|
124936
|
+
"currentSettings": "required",
|
|
124937
|
+
"enabled": "required",
|
|
124938
|
+
"lastChangedAt": "required",
|
|
124939
|
+
"lastFetchedAt": "required",
|
|
124940
|
+
"supportedTargetTypes": "required"
|
|
124941
|
+
},
|
|
124942
|
+
"pump-cycle": {
|
|
124943
|
+
"enabled": "required",
|
|
124944
|
+
"lastFetchedAt": "required",
|
|
124945
|
+
"offTime": "required",
|
|
124946
|
+
"onTime": "required"
|
|
124947
|
+
},
|
|
124948
|
+
"recording-onboard": {
|
|
124949
|
+
"enabled": "required",
|
|
124950
|
+
"lastFetchedAt": "required",
|
|
124951
|
+
"overwriteWhenFull": "required",
|
|
124952
|
+
"postRecordSec": "required",
|
|
124953
|
+
"preRecordSec": "required",
|
|
124954
|
+
"primaryTrackId": "required",
|
|
124955
|
+
"recordingToNowhere": "required",
|
|
124956
|
+
"segmentMinutes": "required",
|
|
124957
|
+
"storage": "required",
|
|
124958
|
+
"tracks": "required",
|
|
124959
|
+
"unreadableWindows": "required",
|
|
124960
|
+
"windows": "required"
|
|
124961
|
+
},
|
|
124962
|
+
"recording-signal": {
|
|
124963
|
+
"active": "required",
|
|
124964
|
+
"lastChangedAt": "required",
|
|
124965
|
+
"lastFetchedAt": "required",
|
|
124966
|
+
"reason": "required"
|
|
124967
|
+
},
|
|
124968
|
+
"running-state": {
|
|
124969
|
+
"lastFetchedAt": "required",
|
|
124970
|
+
"phase": "required",
|
|
124971
|
+
"running": "required",
|
|
124972
|
+
"since": "required",
|
|
124973
|
+
"source": "required"
|
|
124974
|
+
},
|
|
124975
|
+
"scene-monitor": {
|
|
124976
|
+
"lastFetchedAt": "required",
|
|
124977
|
+
"monitors": "required"
|
|
124978
|
+
},
|
|
124979
|
+
"script-runner": {
|
|
124980
|
+
"isRunning": "required",
|
|
124981
|
+
"lastChangedAt": "required",
|
|
124982
|
+
"lastError": "required",
|
|
124983
|
+
"lastRunAt": "required",
|
|
124984
|
+
"lastRunSuccess": "required"
|
|
124985
|
+
},
|
|
124986
|
+
"siren": {
|
|
124987
|
+
"active": "required",
|
|
124988
|
+
"activeUntil": "required",
|
|
124989
|
+
"activeUntilEstimated": "optional",
|
|
124990
|
+
"durationSeconds": "required",
|
|
124991
|
+
"lastFetchedAt": "required",
|
|
124992
|
+
"lastTriggeredAt": "required",
|
|
124993
|
+
"plays": "optional"
|
|
124994
|
+
},
|
|
124995
|
+
"smoke": {
|
|
124996
|
+
"detected": "required",
|
|
124997
|
+
"lastChangedAt": "required"
|
|
124998
|
+
},
|
|
124999
|
+
"stream-catalog": {
|
|
125000
|
+
"descriptors": "required",
|
|
125001
|
+
"lastFetchedAt": "required"
|
|
125002
|
+
},
|
|
125003
|
+
"stream-params": {
|
|
125004
|
+
"ext": "optional",
|
|
125005
|
+
"lastFetchedAt": "required",
|
|
125006
|
+
"main": "optional",
|
|
125007
|
+
"sub": "optional"
|
|
125008
|
+
},
|
|
125009
|
+
"stream-signals": {
|
|
125010
|
+
"lastFetchedAt": "required",
|
|
125011
|
+
"signals": "required"
|
|
125012
|
+
},
|
|
125013
|
+
"switch": {
|
|
125014
|
+
"lastChangedAt": "required",
|
|
125015
|
+
"on": "required"
|
|
125016
|
+
},
|
|
125017
|
+
"tamper": {
|
|
125018
|
+
"lastChangedAt": "required",
|
|
125019
|
+
"tampered": "required"
|
|
125020
|
+
},
|
|
125021
|
+
"temperature-sensor": {
|
|
125022
|
+
"lastFetchedAt": "required",
|
|
125023
|
+
"temperature": "required"
|
|
125024
|
+
},
|
|
125025
|
+
"timed-run": {
|
|
125026
|
+
"activeUntil": "required",
|
|
125027
|
+
"lastFetchedAt": "required",
|
|
125028
|
+
"quickRun": "required",
|
|
125029
|
+
"requestedBy": "required"
|
|
125030
|
+
},
|
|
125031
|
+
"update": {
|
|
125032
|
+
"availableVersion": "required",
|
|
125033
|
+
"currentVersion": "required",
|
|
125034
|
+
"inProgress": "required",
|
|
125035
|
+
"state": "required",
|
|
125036
|
+
"updatable": "required"
|
|
125037
|
+
},
|
|
125038
|
+
"vacuum-control": {
|
|
125039
|
+
"availableFanSpeeds": "required",
|
|
125040
|
+
"batteryLevel": "required",
|
|
125041
|
+
"errorCode": "required",
|
|
125042
|
+
"errorLabel": "required",
|
|
125043
|
+
"fanSpeed": "required",
|
|
125044
|
+
"lastChangedAt": "required",
|
|
125045
|
+
"progress": "required",
|
|
125046
|
+
"state": "required"
|
|
125047
|
+
},
|
|
125048
|
+
"valve": {
|
|
125049
|
+
"lastChangedAt": "required",
|
|
125050
|
+
"position": "required",
|
|
125051
|
+
"state": "required"
|
|
125052
|
+
},
|
|
125053
|
+
"vibration": {
|
|
125054
|
+
"detected": "required",
|
|
125055
|
+
"lastChangedAt": "required"
|
|
125056
|
+
},
|
|
125057
|
+
"water-heater": {
|
|
125058
|
+
"availableModes": "required",
|
|
125059
|
+
"away": "required",
|
|
125060
|
+
"currentTemp": "required",
|
|
125061
|
+
"lastActiveMode": "optional",
|
|
125062
|
+
"lastChangedAt": "required",
|
|
125063
|
+
"maxTemp": "required",
|
|
125064
|
+
"minTemp": "required",
|
|
125065
|
+
"operationMode": "required",
|
|
125066
|
+
"targetTemp": "required"
|
|
125067
|
+
},
|
|
125068
|
+
"weather": {
|
|
125069
|
+
"condition": "required",
|
|
125070
|
+
"humidity": "required",
|
|
125071
|
+
"lastFetchedAt": "required",
|
|
125072
|
+
"pressure": "required",
|
|
125073
|
+
"temperature": "required",
|
|
125074
|
+
"windBearing": "required",
|
|
125075
|
+
"windSpeed": "required"
|
|
125076
|
+
},
|
|
125077
|
+
"weather-station": {
|
|
125078
|
+
"dewPoint": "optional",
|
|
125079
|
+
"feelsLike": "optional",
|
|
125080
|
+
"humidity": "optional",
|
|
125081
|
+
"lastFetchedAt": "required",
|
|
125082
|
+
"pressure": "optional",
|
|
125083
|
+
"rain24h": "optional",
|
|
125084
|
+
"rainDaily": "optional",
|
|
125085
|
+
"rainEvent": "optional",
|
|
125086
|
+
"rainMonthly": "optional",
|
|
125087
|
+
"rainRate": "optional",
|
|
125088
|
+
"rainWeekly": "optional",
|
|
125089
|
+
"rainYearly": "optional",
|
|
125090
|
+
"solarRadiation": "optional",
|
|
125091
|
+
"temperature": "optional",
|
|
125092
|
+
"uv": "optional",
|
|
125093
|
+
"vpd": "optional",
|
|
125094
|
+
"windBearing": "optional",
|
|
125095
|
+
"windBearingAvg": "optional",
|
|
125096
|
+
"windGust": "optional",
|
|
125097
|
+
"windGustMax": "optional",
|
|
125098
|
+
"windSpeed": "optional"
|
|
125099
|
+
},
|
|
125100
|
+
"workload": {
|
|
125101
|
+
"addresses": "required",
|
|
125102
|
+
"autostart": "required",
|
|
125103
|
+
"hostDeviceId": "required",
|
|
125104
|
+
"image": "required",
|
|
125105
|
+
"lastFetchedAt": "required",
|
|
125106
|
+
"os": "required",
|
|
125107
|
+
"ports": "required",
|
|
125108
|
+
"resources": "required",
|
|
125109
|
+
"since": "required",
|
|
125110
|
+
"state": "required",
|
|
125111
|
+
"updateAvailable": "required",
|
|
125112
|
+
"version": "required"
|
|
125113
|
+
},
|
|
125114
|
+
"zone-analytics": {
|
|
125115
|
+
"frame": "required",
|
|
125116
|
+
"frameHeight": "required",
|
|
125117
|
+
"frameWidth": "required",
|
|
125118
|
+
"stationaryObjects": "optional",
|
|
125119
|
+
"ts": "required",
|
|
125120
|
+
"unzoned": "required",
|
|
125121
|
+
"zones": "required"
|
|
125122
|
+
},
|
|
125123
|
+
"zone-rules": {
|
|
125124
|
+
"detection": "required",
|
|
125125
|
+
"motion": "required",
|
|
125126
|
+
"package": "required"
|
|
125127
|
+
},
|
|
125128
|
+
"zones": { "zones": "required" }
|
|
125129
|
+
});
|
|
124486
125130
|
Object.freeze({
|
|
124487
125131
|
"actions": { "run": 363e4 },
|
|
124488
125132
|
"audio-analyzer": { "classify": 3e4 },
|
|
@@ -128349,16 +128993,32 @@ var MigrationPlanSchema = object({ edits: array(discriminatedUnion("op", [
|
|
|
128349
128993
|
}),
|
|
128350
128994
|
object({
|
|
128351
128995
|
op: literal("upsertRecord"),
|
|
128996
|
+
owner: string().min(1),
|
|
128352
128997
|
kind: string().min(1),
|
|
128353
128998
|
recordKey: string().min(1),
|
|
128354
|
-
|
|
128999
|
+
deviceId: number$1().int().positive().optional(),
|
|
129000
|
+
at: number$1().int().nonnegative().optional(),
|
|
129001
|
+
value: record(string(), unknown()),
|
|
128355
129002
|
precondition: PreconditionSchema
|
|
128356
129003
|
}),
|
|
128357
129004
|
object({
|
|
128358
129005
|
op: literal("deleteRecord"),
|
|
129006
|
+
owner: string().min(1),
|
|
128359
129007
|
kind: string().min(1),
|
|
128360
129008
|
recordKey: string().min(1),
|
|
128361
129009
|
precondition: PreconditionSchema
|
|
129010
|
+
}),
|
|
129011
|
+
object({
|
|
129012
|
+
op: literal("rekeyDevice"),
|
|
129013
|
+
deviceId: number$1().int().positive(),
|
|
129014
|
+
addonId: string().min(1),
|
|
129015
|
+
stableId: string().min(1),
|
|
129016
|
+
precondition: PreconditionSchema
|
|
129017
|
+
}),
|
|
129018
|
+
object({
|
|
129019
|
+
op: literal("tombstoneDevice"),
|
|
129020
|
+
deviceId: number$1().int().positive(),
|
|
129021
|
+
precondition: PreconditionSchema
|
|
128362
129022
|
})
|
|
128363
129023
|
])) });
|
|
128364
129024
|
/** `JSON.stringify` with object keys sorted, so equal values spell the same. */
|
|
@@ -162045,7 +162705,7 @@ var mediaPlayerCapability = {
|
|
|
162045
162705
|
]
|
|
162046
162706
|
}
|
|
162047
162707
|
};
|
|
162048
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Gateway, 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.PetFeeder, DeviceType.MediaPlayer, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation;
|
|
162708
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.HeatPump, DeviceType.HeatPump, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Gateway, 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.PetFeeder, DeviceType.MediaPlayer, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation;
|
|
162049
162709
|
var NUMBER = {
|
|
162050
162710
|
kind: "fixed",
|
|
162051
162711
|
result: ["number"]
|
|
@@ -170468,6 +171128,43 @@ function heatPumpInstantCop(power) {
|
|
|
170468
171128
|
if (thermalW === null || electricalW === null || electricalW <= 0) return null;
|
|
170469
171129
|
return thermalW / electricalW;
|
|
170470
171130
|
}
|
|
171131
|
+
var HEAT_PUMP_CUSTOMIZE_DEVICE_TYPES = [DeviceType.HeatPump];
|
|
171132
|
+
/** One electrical reading the operator may take from a device they pick, unit checked. */
|
|
171133
|
+
function electricalTarget(id, path, unit) {
|
|
171134
|
+
return {
|
|
171135
|
+
id,
|
|
171136
|
+
cardinality: "scalar",
|
|
171137
|
+
vocabulary: { cap: "heat-pump-status" },
|
|
171138
|
+
deviceTypes: HEAT_PUMP_CUSTOMIZE_DEVICE_TYPES,
|
|
171139
|
+
apply: "replace",
|
|
171140
|
+
path,
|
|
171141
|
+
sources: [{
|
|
171142
|
+
kind: "numeric",
|
|
171143
|
+
requiredUnit: unit,
|
|
171144
|
+
transforms: [{ kind: "identity" }]
|
|
171145
|
+
}],
|
|
171146
|
+
sourceReport: { status: "assignment-status" }
|
|
171147
|
+
};
|
|
171148
|
+
}
|
|
171149
|
+
var HEAT_PUMP_TARGETS = [electricalTarget("electrical-power", "power.electricalW", "W"), electricalTarget("electrical-energy", "energy.electricalKwh", "kWh")];
|
|
171150
|
+
/**
|
|
171151
|
+
* Customize (D984, #476): a gateway that reports no instantaneous electrical
|
|
171152
|
+
* power (the cloud ones) or whose energy meter the operator trusts less than a
|
|
171153
|
+
* dedicated one lets the OPERATOR pick a device for `power.electricalW` and
|
|
171154
|
+
* `energy.electricalKwh` — a `replace` over a field listed in `overridable`,
|
|
171155
|
+
* nothing else. The replaced value IS the cap field, so the instant COP, the
|
|
171156
|
+
* hero pills and the history use it; nothing is linked by itself (D356), the
|
|
171157
|
+
* unit is checked, and a source that does not answer releases the field back to
|
|
171158
|
+
* the native reading (never a 0, D393).
|
|
171159
|
+
*/
|
|
171160
|
+
var heatPumpStatusCustomize = {
|
|
171161
|
+
version: 1,
|
|
171162
|
+
overridable: HEAT_PUMP_TARGETS.map((target) => ({
|
|
171163
|
+
path: target.path,
|
|
171164
|
+
by: target.id
|
|
171165
|
+
})),
|
|
171166
|
+
targets: HEAT_PUMP_TARGETS
|
|
171167
|
+
};
|
|
170471
171168
|
var heatPumpStatusCapability = {
|
|
170472
171169
|
name: "heat-pump-status",
|
|
170473
171170
|
scope: "device",
|
|
@@ -170486,6 +171183,7 @@ var heatPumpStatusCapability = {
|
|
|
170486
171183
|
* (the series are recorded). See `RuntimeStateDurability`.
|
|
170487
171184
|
*/
|
|
170488
171185
|
durability: "session",
|
|
171186
|
+
customize: heatPumpStatusCustomize,
|
|
170489
171187
|
/**
|
|
170490
171188
|
* History (D850, D917): `circuits[]` is a keyed array — one series per circuit and
|
|
170491
171189
|
* field, named by the circuit's label. The mode is a state (D896); the energy
|
|
@@ -172277,6 +172975,8 @@ var IntegrationInstanceKindSchema = object({
|
|
|
172277
172975
|
role: IntegrationInstanceRoleSchema.optional(),
|
|
172278
172976
|
/** `testInstance` really probes the remote for this kind; absent takes the provider's `canTest`. */
|
|
172279
172977
|
canTest: boolean().optional(),
|
|
172978
|
+
/** `false`: Add never offers this kind (the system creates its one instance, e.g. a default integration). Absent = creatable. */
|
|
172979
|
+
creatable: boolean().optional(),
|
|
172280
172980
|
/** The kind signs in through a server-held interactive session. */
|
|
172281
172981
|
signIn: object({
|
|
172282
172982
|
basePath: string().min(1),
|
|
@@ -186828,6 +187528,7 @@ var HardwareClassIdSchema = _enum([
|
|
|
186828
187528
|
"apple-m-base",
|
|
186829
187529
|
"apple-m-pro",
|
|
186830
187530
|
"amd-phoenix",
|
|
187531
|
+
"nvidia-gpu",
|
|
186831
187532
|
"unknown"
|
|
186832
187533
|
]);
|
|
186833
187534
|
var AcceleratorKindSchema = _enum([
|
|
@@ -186835,6 +187536,7 @@ var AcceleratorKindSchema = _enum([
|
|
|
186835
187536
|
"intel-igpu",
|
|
186836
187537
|
"amd-igpu",
|
|
186837
187538
|
"amd-npu",
|
|
187539
|
+
"nvidia-gpu",
|
|
186838
187540
|
"x86-cpu",
|
|
186839
187541
|
"arm-cpu",
|
|
186840
187542
|
"apple-ane",
|
|
@@ -222008,6 +222710,19 @@ object({
|
|
|
222008
222710
|
delay: number$1().nonnegative().optional(),
|
|
222009
222711
|
commands: record(string(), unknown())
|
|
222010
222712
|
});
|
|
222713
|
+
/** The `instance-select` field of a link, keyed like the body field it fills. */
|
|
222714
|
+
function linkFieldDescriptor(key, target, labels) {
|
|
222715
|
+
return {
|
|
222716
|
+
type: "instance-select",
|
|
222717
|
+
key,
|
|
222718
|
+
label: labels.label,
|
|
222719
|
+
...labels.description !== void 0 ? { description: labels.description } : {},
|
|
222720
|
+
required: labels.required ?? true,
|
|
222721
|
+
...labels.noneLabel !== void 0 ? { noneLabel: labels.noneLabel } : {},
|
|
222722
|
+
functionCap: target.cap,
|
|
222723
|
+
...target.kind !== void 0 ? { kind: target.kind } : {}
|
|
222724
|
+
};
|
|
222725
|
+
}
|
|
222011
222726
|
//#endregion
|
|
222012
222727
|
//#region src/clips/clip-prefetch.ts
|
|
222013
222728
|
/** The longest a device may stay quiet after refusals, whatever its interval. */
|
|
@@ -222507,6 +223222,11 @@ var reolinkCameraSchema = object({
|
|
|
222507
223222
|
/** Empty for a camera adopted from an NVR / Home Hub: it borrows its integration's session. */
|
|
222508
223223
|
password: string().default("").describe("Password").meta({ secret: true }),
|
|
222509
223224
|
/**
|
|
223225
|
+
* The SMTP password last written to the camera on the Email tab (or by Auto-configure email
|
|
223226
|
+
* push). A keychain secret: the form shows set / not set, never the value.
|
|
223227
|
+
*/
|
|
223228
|
+
emailPassword: string().default("").describe("Camera SMTP password").meta({ secret: true }),
|
|
223229
|
+
/**
|
|
222510
223230
|
* Transport mode resolved at creation time by autodetect (Slice 15).
|
|
222511
223231
|
* - `tcp` : standard TCP-based Baichuan (regular cameras, NVR/Hub)
|
|
222512
223232
|
* - `udp` : BCUDP-based Baichuan (battery cams, UDP-only models like
|
|
@@ -222834,6 +223554,17 @@ var reolinkCameraSchema = object({
|
|
|
222834
223554
|
supported: boolean().optional()
|
|
222835
223555
|
}).optional(),
|
|
222836
223556
|
/**
|
|
223557
|
+
* The power source of a battery camera (`getPowerSource`): `adapter`,
|
|
223558
|
+
* `battery`, or `unknown` when the read failed or the firmware is
|
|
223559
|
+
* silent. Drives the Advanced tab's "Power source" setting; `unknown`
|
|
223560
|
+
* hides it.
|
|
223561
|
+
*/
|
|
223562
|
+
powerSourceSnapshot: object({ source: _enum([
|
|
223563
|
+
"adapter",
|
|
223564
|
+
"battery",
|
|
223565
|
+
"unknown"
|
|
223566
|
+
]) }).optional(),
|
|
223567
|
+
/**
|
|
222837
223568
|
* Snapshot of the camera's auto-reboot schedule from
|
|
222838
223569
|
* `getAutoReboot` (cmd_id 101). Drives the "Auto reboot" section
|
|
222839
223570
|
* defaults on the Advanced tab. `weekDay` is the lib's `DayOfWeek`
|
|
@@ -229115,6 +229846,17 @@ function deriveReolinkCameraFeatures(inputs) {
|
|
|
229115
229846
|
return out;
|
|
229116
229847
|
}
|
|
229117
229848
|
//#endregion
|
|
229849
|
+
//#region src/email-smtp-password.ts
|
|
229850
|
+
/**
|
|
229851
|
+
* The camera SMTP password an operator wrote on the Email tab, when it is a real value to push
|
|
229852
|
+
* to the camera and keep: a non-empty string that is not a keychain marker. Blank means "keep
|
|
229853
|
+
* the stored one" and a marker is the form echoing back what it was shown; neither is a write.
|
|
229854
|
+
*/
|
|
229855
|
+
function smtpPasswordToWrite(value) {
|
|
229856
|
+
if (typeof value !== "string" || value.length === 0) return null;
|
|
229857
|
+
return isSecretMarker(value) ? null : value;
|
|
229858
|
+
}
|
|
229859
|
+
//#endregion
|
|
229118
229860
|
//#region src/hub-child-settings.ts
|
|
229119
229861
|
/**
|
|
229120
229862
|
* A camera adopted under an NVR / Home Hub dials through the integration's session: the address
|
|
@@ -231748,6 +232490,13 @@ var PirAccessory = class extends BaseDevice {
|
|
|
231748
232490
|
* inverse `101 - userValue` (lower raw = more sensitive).
|
|
231749
232491
|
* Mirrors `refreshSwitchFromExternal`'s reverse transform. */
|
|
231750
232492
|
async pushConfigToFirmware(enable) {
|
|
232493
|
+
if (this.parent.wakeForWrite && !await this.parent.wakeForWrite()) {
|
|
232494
|
+
this.ctx.logger.warn("pir write not sent — the battery camera could not be woken", {
|
|
232495
|
+
tags: { deviceId: this.id },
|
|
232496
|
+
meta: { channel: this.channel }
|
|
232497
|
+
});
|
|
232498
|
+
throw new Error("The camera is asleep and could not be woken; try again in a moment.");
|
|
232499
|
+
}
|
|
231751
232500
|
const api = await this.api;
|
|
231752
232501
|
const sensitive = this.config.get("pirSensitive");
|
|
231753
232502
|
const reduceAlarm = this.config.get("pirReduceAlarm");
|
|
@@ -233643,10 +234392,9 @@ var PowerSourceReadingSchema = _enum([
|
|
|
233643
234392
|
"battery",
|
|
233644
234393
|
"unknown"
|
|
233645
234394
|
]);
|
|
233646
|
-
var ReadPowerSourceResultSchema = object({ source: PowerSourceReadingSchema });
|
|
233647
234395
|
/** The device (or this code) declined before any real write was sent. */
|
|
233648
234396
|
var PowerSourceRefusalReasonSchema = _enum(["dry-run-refused", "dry-run-failed"]);
|
|
233649
|
-
|
|
234397
|
+
discriminatedUnion("outcome", [
|
|
233650
234398
|
object({
|
|
233651
234399
|
outcome: literal("refused"),
|
|
233652
234400
|
mode: PowerSourceModeSchema,
|
|
@@ -233790,6 +234538,54 @@ async function switchPowerSourceTo(target, mode) {
|
|
|
233790
234538
|
applied
|
|
233791
234539
|
};
|
|
233792
234540
|
}
|
|
234541
|
+
/** The settings key of the power source: an ordinary select, owned by the camera (never stored). */
|
|
234542
|
+
var POWER_SOURCE_SETTING_KEY = "powerSource";
|
|
234543
|
+
/**
|
|
234544
|
+
* The power source as a setting, in its own section of the Advanced tab.
|
|
234545
|
+
* Only a battery camera whose read ANSWERED with a mode has one: a camera that
|
|
234546
|
+
* was never asked, or that did not answer, shows nothing rather than a guess.
|
|
234547
|
+
*/
|
|
234548
|
+
function buildPowerSourceSettingsSection(input) {
|
|
234549
|
+
const { isBattery, source } = input;
|
|
234550
|
+
if (!isBattery || source === void 0 || source === "unknown") return [];
|
|
234551
|
+
return [{
|
|
234552
|
+
id: "power-source",
|
|
234553
|
+
tab: "advanced",
|
|
234554
|
+
title: "Power source",
|
|
234555
|
+
titleKey: "provider-reolink:schema.s_power-source.title",
|
|
234556
|
+
description: "Only switch to wired power when the adapter meets the camera's spec.",
|
|
234557
|
+
descriptionKey: "provider-reolink:schema.s_power-source.description",
|
|
234558
|
+
columns: 1,
|
|
234559
|
+
fields: [{
|
|
234560
|
+
type: "select",
|
|
234561
|
+
key: POWER_SOURCE_SETTING_KEY,
|
|
234562
|
+
label: "Power source",
|
|
234563
|
+
labelKey: "provider-reolink:schema.s_power-source.powerSource.label",
|
|
234564
|
+
default: source,
|
|
234565
|
+
options: [{
|
|
234566
|
+
value: "adapter",
|
|
234567
|
+
label: "Wired power",
|
|
234568
|
+
labelKey: "provider-reolink:schema.s_power-source.powerSource.o_adapter.label"
|
|
234569
|
+
}, {
|
|
234570
|
+
value: "battery",
|
|
234571
|
+
label: "Battery power",
|
|
234572
|
+
labelKey: "provider-reolink:schema.s_power-source.powerSource.o_battery.label"
|
|
234573
|
+
}]
|
|
234574
|
+
}]
|
|
234575
|
+
}];
|
|
234576
|
+
}
|
|
234577
|
+
/**
|
|
234578
|
+
* Apply the setting: switch the camera and REFUSE to call a switch that did not
|
|
234579
|
+
* land a success — the settings form keeps the operator's edit, marked unsaved.
|
|
234580
|
+
*/
|
|
234581
|
+
async function applyPowerSourceSetting(target, value) {
|
|
234582
|
+
const mode = PowerSourceModeSchema.safeParse(value);
|
|
234583
|
+
if (!mode.success) throw new Error(`Not a power source: ${String(value)}`);
|
|
234584
|
+
const outcome = await switchPowerSourceTo(target, mode.data);
|
|
234585
|
+
if (outcome.outcome === "refused") throw new Error(`The camera refused the power source switch (${outcome.reason})`);
|
|
234586
|
+
if (outcome.outcome === "failed") throw new Error(`The power source switch failed: ${outcome.error}`);
|
|
234587
|
+
if (!outcome.applied) throw new Error(`The camera did not take the power source switch (it reports ${outcome.after})`);
|
|
234588
|
+
}
|
|
233793
234589
|
//#endregion
|
|
233794
234590
|
//#region src/ptz-zoom.ts
|
|
233795
234591
|
/**
|
|
@@ -234763,6 +235559,7 @@ function slicesForPatch(patch) {
|
|
|
234763
235559
|
if (has("pirReduceFalseAlarm")) out.add("pir");
|
|
234764
235560
|
if (has("autoRebootEnabled", "autoRebootWeekDay", "autoRebootHour", "autoRebootMinute")) out.add("autoReboot");
|
|
234765
235561
|
if (has("timeZoneId")) out.add("systemGeneral");
|
|
235562
|
+
if (has("powerSource")) out.add("powerSource");
|
|
234766
235563
|
return out;
|
|
234767
235564
|
}
|
|
234768
235565
|
/**
|
|
@@ -234779,8 +235576,6 @@ var RefreshSettingsResultSchema = object({
|
|
|
234779
235576
|
capsWarmed: number$1(),
|
|
234780
235577
|
capsTotal: number$1()
|
|
234781
235578
|
});
|
|
234782
|
-
/** The two switch actions, one implementation each way. */
|
|
234783
|
-
var POWER_SWITCH_ACTIONS = [["switch-to-wired-power", "adapter"], ["switch-to-battery-power", "battery"]];
|
|
234784
235579
|
/** The uid out of a device's metadata bag, or nothing. Never a cast. */
|
|
234785
235580
|
function metaUid(metadata) {
|
|
234786
235581
|
if (metadata === null) return void 0;
|
|
@@ -235588,6 +236383,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
235588
236383
|
} catch (err) {
|
|
235589
236384
|
this.ctx.logger.debug("reolink getPirInfo probe failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
235590
236385
|
}
|
|
236386
|
+
if (want("powerSource") && this.isBattery) cacheUpdate.powerSourceSnapshot = { source: await readPowerSource(await this.powerSourceTarget()) };
|
|
235591
236387
|
if (want("autoReboot")) try {
|
|
235592
236388
|
const reboot = await api.getAutoReboot();
|
|
235593
236389
|
cacheUpdate.autoRebootSnapshot = {
|
|
@@ -235940,6 +236736,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
235940
236736
|
runTest: false
|
|
235941
236737
|
}, this.getChannel());
|
|
235942
236738
|
this.ctx.logger.info("email-push: camera auto-configure applied", { tags: { deviceId: this.id } });
|
|
236739
|
+
if (params.authPassword !== void 0) await this.config.setAll({ emailPassword: params.authPassword });
|
|
235943
236740
|
await this.refreshCameraEmailConfig().catch(() => {});
|
|
235944
236741
|
}
|
|
235945
236742
|
/**
|
|
@@ -236166,16 +236963,6 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
236166
236963
|
capsTotal
|
|
236167
236964
|
};
|
|
236168
236965
|
});
|
|
236169
|
-
if (this.isBattery) {
|
|
236170
|
-
this.registerDeviceAction("read-power-source", deviceCustomAction(unknown(), ReadPowerSourceResultSchema, { kind: "mutation" }), async () => {
|
|
236171
|
-
await this.wakeIfSleeping();
|
|
236172
|
-
return { source: await readPowerSource(await this.powerSourceTarget()) };
|
|
236173
|
-
});
|
|
236174
|
-
for (const [action, mode] of POWER_SWITCH_ACTIONS) this.registerDeviceAction(action, deviceCustomAction(unknown(), SwitchPowerSourceResultSchema, { kind: "mutation" }), async () => {
|
|
236175
|
-
await this.wakeIfSleeping();
|
|
236176
|
-
return switchPowerSourceTo(await this.powerSourceTarget(), mode);
|
|
236177
|
-
});
|
|
236178
|
-
}
|
|
236179
236966
|
this.registerDeviceAction("refresh-sessions", deviceCustomAction(unknown(), _void(), { kind: "mutation" }), async () => {
|
|
236180
236967
|
await this.refreshSessionsSnapshot();
|
|
236181
236968
|
});
|
|
@@ -236725,56 +237512,6 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
236725
237512
|
};
|
|
236726
237513
|
}
|
|
236727
237514
|
/**
|
|
236728
|
-
* Battery-cam power-source section (General tab): read the source, switch to
|
|
236729
|
-
* wired or back to battery. Returns `[]` for a wired-only camera. The buttons
|
|
236730
|
-
* dispatch the `read-power-source` / `switch-to-*-power` device actions.
|
|
236731
|
-
*/
|
|
236732
|
-
buildPowerSourceSection() {
|
|
236733
|
-
if (!this.isBattery) return [];
|
|
236734
|
-
const switchMessage = "Switch {outcome} · before: {before} · after: {after} · applied: {applied}";
|
|
236735
|
-
return [{
|
|
236736
|
-
id: "power-source",
|
|
236737
|
-
tab: "general",
|
|
236738
|
-
title: "Power source",
|
|
236739
|
-
titleKey: "provider-reolink:schema.s_power-source.title",
|
|
236740
|
-
description: "Only switch to wired power when the adapter meets the camera's spec.",
|
|
236741
|
-
descriptionKey: "provider-reolink:schema.s_power-source.description",
|
|
236742
|
-
columns: 1,
|
|
236743
|
-
fields: [
|
|
236744
|
-
{
|
|
236745
|
-
type: "device-action-button",
|
|
236746
|
-
key: "_readPowerSource",
|
|
236747
|
-
label: "Power source",
|
|
236748
|
-
labelKey: "provider-reolink:schema.s_power-source._readPowerSource.label",
|
|
236749
|
-
buttonLabel: "Read power source",
|
|
236750
|
-
action: "read-power-source",
|
|
236751
|
-
variant: "default",
|
|
236752
|
-
successMessage: "Power source: {source}"
|
|
236753
|
-
},
|
|
236754
|
-
{
|
|
236755
|
-
type: "device-action-button",
|
|
236756
|
-
key: "_switchToWiredPower",
|
|
236757
|
-
label: "Wired power",
|
|
236758
|
-
labelKey: "provider-reolink:schema.s_power-source._switchToWiredPower.label",
|
|
236759
|
-
buttonLabel: "Switch to wired power",
|
|
236760
|
-
action: "switch-to-wired-power",
|
|
236761
|
-
variant: "default",
|
|
236762
|
-
successMessage: switchMessage
|
|
236763
|
-
},
|
|
236764
|
-
{
|
|
236765
|
-
type: "device-action-button",
|
|
236766
|
-
key: "_switchToBatteryPower",
|
|
236767
|
-
label: "Battery power",
|
|
236768
|
-
labelKey: "provider-reolink:schema.s_power-source._switchToBatteryPower.label",
|
|
236769
|
-
buttonLabel: "Switch to battery power",
|
|
236770
|
-
action: "switch-to-battery-power",
|
|
236771
|
-
variant: "default",
|
|
236772
|
-
successMessage: switchMessage
|
|
236773
|
-
}
|
|
236774
|
-
]
|
|
236775
|
-
}];
|
|
236776
|
-
}
|
|
236777
|
-
/**
|
|
236778
237515
|
* Battery-cam Email Push auto-configure section. Returns `[]` for any
|
|
236779
237516
|
* camera that wouldn't benefit (wired cams keep a live socket for
|
|
236780
237517
|
* native push; hub children have no independent email path). The
|
|
@@ -236965,7 +237702,8 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
236965
237702
|
if (typeof fields.emailSmtpServer === "string") patch.smtpServer = fields.emailSmtpServer;
|
|
236966
237703
|
if (typeof fields.emailSmtpPort === "number") patch.smtpPort = fields.emailSmtpPort;
|
|
236967
237704
|
if (typeof fields.emailUserName === "string") patch.userName = fields.emailUserName;
|
|
236968
|
-
|
|
237705
|
+
const smtpPassword = smtpPasswordToWrite(fields.emailPassword);
|
|
237706
|
+
if (smtpPassword !== null) patch.password = smtpPassword;
|
|
236969
237707
|
if (typeof fields.emailSsl === "boolean") patch.ssl = fields.emailSsl ? 1 : 0;
|
|
236970
237708
|
if (typeof fields.emailRecipient1 === "string") patch.address1 = fields.emailRecipient1;
|
|
236971
237709
|
if (typeof fields.emailRecipient2 === "string") patch.address2 = fields.emailRecipient2;
|
|
@@ -241686,7 +242424,10 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
241686
242424
|
}),
|
|
241687
242425
|
...this.buildSessionsTabSections(),
|
|
241688
242426
|
...this.buildEmailPushSection(),
|
|
241689
|
-
...
|
|
242427
|
+
...buildPowerSourceSettingsSection({
|
|
242428
|
+
isBattery: this.isBattery,
|
|
242429
|
+
source: cache?.powerSourceSnapshot?.source
|
|
242430
|
+
}),
|
|
241690
242431
|
...this.buildEmailTabSections(),
|
|
241691
242432
|
...buildClipRefreshDeviceSection({
|
|
241692
242433
|
isHubChild: this.isHubChild(),
|
|
@@ -241715,7 +242456,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
241715
242456
|
emailSmtpServer: emailSnap?.smtpServer ?? "",
|
|
241716
242457
|
emailSmtpPort: emailSnap?.smtpPort ?? 587,
|
|
241717
242458
|
emailUserName: emailSnap?.userName ?? "",
|
|
241718
|
-
emailPassword: "",
|
|
242459
|
+
emailPassword: this.config.get("emailPassword"),
|
|
241719
242460
|
emailSsl: emailSnap?.ssl ?? false,
|
|
241720
242461
|
emailRecipient1: emailSnap?.recipients?.[0] ?? "",
|
|
241721
242462
|
emailRecipient2: emailSnap?.recipients?.[1] ?? "",
|
|
@@ -241782,6 +242523,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
241782
242523
|
audioNoiseLevel: this.config.get("audioNoiseLevel") ?? (cache?.audioNoiseSnapshot?.enabled ? cache.audioNoiseSnapshot?.level ?? 1 : 0),
|
|
241783
242524
|
autoFocusEnabled: this.config.get("autoFocusEnabled") ?? cache?.autoFocusSnapshot?.enabled ?? true,
|
|
241784
242525
|
pirReduceFalseAlarm: this.config.get("pirReduceFalseAlarm") ?? cache?.pirSnapshot?.reduceFalseAlarm ?? false,
|
|
242526
|
+
...cache?.powerSourceSnapshot !== void 0 ? { [POWER_SOURCE_SETTING_KEY]: cache.powerSourceSnapshot.source } : {},
|
|
241785
242527
|
gop: this.config.get("gop") ?? cache?.encSnapshot?.mainStream?.gop ?? 4,
|
|
241786
242528
|
autoRebootEnabled: this.config.get("autoRebootEnabled") ?? cache?.autoRebootSnapshot?.enabled ?? false,
|
|
241787
242529
|
autoRebootWeekDay: this.config.get("autoRebootWeekDay") ?? cache?.autoRebootSnapshot?.weekDay ?? "everyday",
|
|
@@ -241811,8 +242553,8 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
241811
242553
|
}
|
|
241812
242554
|
async applySettingsPatch(patch) {
|
|
241813
242555
|
if (this.isHubChild()) this.refuseHubChildPatch(patch);
|
|
241814
|
-
const { emailSmtpServer, emailSmtpPort, emailUserName, emailPassword, emailSsl, emailRecipient1, emailRecipient2, emailRecipient3, emailSendNickname, emailScheduleEnabled, osdChannelEnabled, osdChannelName, osdChannelPosition, osdTimeEnabled, osdTimePosition, osdWatermark, hubName: _hubName, ...rest } = patch;
|
|
241815
|
-
if ((osdChannelEnabled !== void 0 || osdChannelName !== void 0 || osdChannelPosition !== void 0 || osdTimeEnabled !== void 0 || osdTimePosition !== void 0 || osdWatermark !== void 0 || emailSmtpServer !== void 0 || emailRecipient1 !== void 0) && !await this.wakeIfSleeping()) this.ctx.logger.warn("settings write: battery cam did not wake — writing anyway", { tags: { deviceId: this.id } });
|
|
242556
|
+
const { emailSmtpServer, emailSmtpPort, emailUserName, emailPassword, emailSsl, emailRecipient1, emailRecipient2, emailRecipient3, emailSendNickname, emailScheduleEnabled, osdChannelEnabled, osdChannelName, osdChannelPosition, osdTimeEnabled, osdTimePosition, osdWatermark, hubName: _hubName, [POWER_SOURCE_SETTING_KEY]: powerSource, ...rest } = patch;
|
|
242557
|
+
if ((osdChannelEnabled !== void 0 || osdChannelName !== void 0 || osdChannelPosition !== void 0 || osdTimeEnabled !== void 0 || osdTimePosition !== void 0 || osdWatermark !== void 0 || emailSmtpServer !== void 0 || emailRecipient1 !== void 0 || powerSource !== void 0) && !await this.wakeIfSleeping()) this.ctx.logger.warn("settings write: battery cam did not wake — writing anyway", { tags: { deviceId: this.id } });
|
|
241816
242558
|
const emailFields = {
|
|
241817
242559
|
emailSmtpServer,
|
|
241818
242560
|
emailSmtpPort,
|
|
@@ -241825,12 +242567,18 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
241825
242567
|
emailSendNickname,
|
|
241826
242568
|
emailScheduleEnabled
|
|
241827
242569
|
};
|
|
241828
|
-
if (Object.values(emailFields).some((v) => v !== void 0))
|
|
241829
|
-
|
|
241830
|
-
|
|
241831
|
-
|
|
242570
|
+
if (Object.values(emailFields).some((v) => v !== void 0)) {
|
|
242571
|
+
let written = true;
|
|
242572
|
+
await this.applyEmailConfigPatch(emailFields).catch((err) => {
|
|
242573
|
+
written = false;
|
|
242574
|
+
this.ctx.logger.warn("email config write failed", {
|
|
242575
|
+
tags: { deviceId: this.id },
|
|
242576
|
+
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
242577
|
+
});
|
|
241832
242578
|
});
|
|
241833
|
-
|
|
242579
|
+
const stored = smtpPasswordToWrite(emailPassword);
|
|
242580
|
+
if (written && stored !== null) await this.config.setAll({ emailPassword: stored });
|
|
242581
|
+
}
|
|
241834
242582
|
const osdPatch = buildOsdPatch({
|
|
241835
242583
|
osdChannelEnabled,
|
|
241836
242584
|
osdChannelName,
|
|
@@ -241847,6 +242595,10 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
241847
242595
|
osdTimePosition,
|
|
241848
242596
|
osdWatermark
|
|
241849
242597
|
].some((v) => v !== void 0);
|
|
242598
|
+
if (powerSource !== void 0) {
|
|
242599
|
+
await applyPowerSourceSetting(await this.powerSourceTarget(), powerSource);
|
|
242600
|
+
await this.refreshParentSettingsSnapshot(new Set(["powerSource"]), "post-write");
|
|
242601
|
+
}
|
|
241850
242602
|
if (Object.keys(rest).length === 0 && !hasOsdPatch) return;
|
|
241851
242603
|
if (Object.keys(rest).length > 0) await this.config.setAll(rest);
|
|
241852
242604
|
const typedPatch = patch;
|
|
@@ -242281,6 +243033,11 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
242281
243033
|
isSleeping() {
|
|
242282
243034
|
return this.sleeping;
|
|
242283
243035
|
}
|
|
243036
|
+
/** Implements `ReolinkAccessoryHost.wakeForWrite`: an accessory's operator
|
|
243037
|
+
* write (PIR, ...) wakes a sleeping battery camera first. */
|
|
243038
|
+
wakeForWrite() {
|
|
243039
|
+
return this.wakeIfSleeping();
|
|
243040
|
+
}
|
|
242284
243041
|
async ensureApi() {
|
|
242285
243042
|
if (this.isHubChild()) {
|
|
242286
243043
|
const session = this.hubSession();
|
|
@@ -243305,6 +244062,8 @@ var EmailPushBridge = class {
|
|
|
243305
244062
|
/** The last failure that was reported, so a mailbox provider that stays away is said once. */
|
|
243306
244063
|
lastFailure = null;
|
|
243307
244064
|
chain = Promise.resolve();
|
|
244065
|
+
/** The integrations whose empty link this process filled (only those are released). */
|
|
244066
|
+
filled = /* @__PURE__ */ new Set();
|
|
243308
244067
|
constructor(deps) {
|
|
243309
244068
|
this.deps = deps;
|
|
243310
244069
|
}
|
|
@@ -243375,43 +244134,104 @@ var EmailPushBridge = class {
|
|
|
243375
244134
|
const recipients = this.recipients();
|
|
243376
244135
|
if (recipients.length === 0) {
|
|
243377
244136
|
if (this.brokerId !== null && this.subscriptionId !== null) await this.deps.port.unsubscribe(this.brokerId, this.subscriptionId);
|
|
243378
|
-
if (this.brokerId !== null) await this.syncLinks(this.brokerId,
|
|
244137
|
+
if (this.brokerId !== null) await this.syncLinks(this.brokerId, await this.tryDefaultId(), false);
|
|
243379
244138
|
this.subscriptionId = null;
|
|
243380
244139
|
this.declared = null;
|
|
243381
244140
|
return;
|
|
243382
244141
|
}
|
|
243383
|
-
const
|
|
243384
|
-
const
|
|
244142
|
+
const { defaultId, complete } = await this.resolveDefault();
|
|
244143
|
+
const picked = await this.pickedMailbox(defaultId);
|
|
244144
|
+
const key = `${recipients.join(",")}|${defaultId ?? ""}|${picked ?? this.brokerId ?? ""}`;
|
|
243385
244145
|
if (!force && this.declared === key && this.subscriptionId !== null) return;
|
|
243386
|
-
const brokerId = await this.ensureMailbox();
|
|
244146
|
+
const brokerId = picked ?? await this.ensureMailbox();
|
|
244147
|
+
if (this.brokerId !== null && this.brokerId !== brokerId && this.subscriptionId !== null) {
|
|
244148
|
+
await this.deps.port.unsubscribe(this.brokerId, this.subscriptionId);
|
|
244149
|
+
this.subscriptionId = null;
|
|
244150
|
+
}
|
|
243387
244151
|
await this.seedBaseline(brokerId);
|
|
243388
244152
|
const { subscriptionId } = await this.deps.port.subscribe(brokerId, recipients);
|
|
243389
244153
|
this.brokerId = brokerId;
|
|
243390
244154
|
this.subscriptionId = subscriptionId;
|
|
243391
|
-
|
|
244155
|
+
const linked = await this.syncLinks(brokerId, defaultId, true);
|
|
244156
|
+
this.declared = linked && complete ? `${recipients.join(",")}|${defaultId ?? ""}|${brokerId}` : null;
|
|
243392
244157
|
await this.reconcile();
|
|
243393
244158
|
}
|
|
243394
|
-
/**
|
|
243395
|
-
|
|
243396
|
-
|
|
243397
|
-
|
|
243398
|
-
|
|
244159
|
+
/**
|
|
244160
|
+
* The default integration holds the mailbox link for every email-push camera (a hub child's
|
|
244161
|
+
* integration carries none). `complete` is false when it could not be resolved: the caller
|
|
244162
|
+
* retries at the next sync.
|
|
244163
|
+
*/
|
|
244164
|
+
async resolveDefault() {
|
|
244165
|
+
const cam = this.deps.listCameras().find((c) => c.isEmailPushEligible);
|
|
244166
|
+
const tags = cam === void 0 ? {} : { tags: { deviceId: cam.id } };
|
|
244167
|
+
let defaultId = null;
|
|
244168
|
+
try {
|
|
244169
|
+
defaultId = await this.deps.defaultIntegrationId();
|
|
244170
|
+
} catch (err) {
|
|
244171
|
+
this.deps.logger.warn("email-push: the default integration could not be read", {
|
|
244172
|
+
...tags,
|
|
244173
|
+
meta: { error: errMsg(err) }
|
|
244174
|
+
});
|
|
244175
|
+
return {
|
|
244176
|
+
defaultId: null,
|
|
244177
|
+
complete: false
|
|
244178
|
+
};
|
|
244179
|
+
}
|
|
244180
|
+
if (defaultId === null) {
|
|
244181
|
+
this.deps.logger.warn("email-push: a camera uses the mailbox but the default integration is not resolved yet; retrying at the next sync", tags);
|
|
244182
|
+
return {
|
|
244183
|
+
defaultId: null,
|
|
244184
|
+
complete: false
|
|
244185
|
+
};
|
|
244186
|
+
}
|
|
244187
|
+
return {
|
|
244188
|
+
defaultId,
|
|
244189
|
+
complete: true
|
|
244190
|
+
};
|
|
244191
|
+
}
|
|
244192
|
+
async tryDefaultId() {
|
|
244193
|
+
try {
|
|
244194
|
+
return await this.deps.defaultIntegrationId();
|
|
244195
|
+
} catch {
|
|
244196
|
+
return null;
|
|
244197
|
+
}
|
|
244198
|
+
}
|
|
244199
|
+
/**
|
|
244200
|
+
* The mailbox the operator picked on the default integration, or null while none is picked.
|
|
244201
|
+
* A pick that no mailbox answers to throws: the bridge never swaps it for another one.
|
|
244202
|
+
*/
|
|
244203
|
+
async pickedMailbox(defaultId) {
|
|
244204
|
+
if (defaultId === null) return null;
|
|
244205
|
+
const row = (await this.deps.links.list()).find((r) => r.id === defaultId);
|
|
244206
|
+
if (row === void 0 || row.mailboxId === "") return null;
|
|
244207
|
+
if (!(await this.deps.port.list()).some((m) => m.id === row.mailboxId)) throw new Error(`the camera mailbox picked on the default integration (${row.mailboxId}) does not exist`);
|
|
244208
|
+
return row.mailboxId;
|
|
244209
|
+
}
|
|
244210
|
+
/** The mailbox a camera is pointed at: the operator's pick, else the one this addon adopts or creates. */
|
|
244211
|
+
async resolveMailbox() {
|
|
244212
|
+
return await this.pickedMailbox(await this.tryDefaultId()) ?? await this.ensureMailbox();
|
|
243399
244213
|
}
|
|
243400
244214
|
/**
|
|
243401
|
-
* Make the `mailboxId`
|
|
243402
|
-
*
|
|
243403
|
-
*
|
|
243404
|
-
*
|
|
244215
|
+
* Make the `mailboxId` link of the DEFAULT integration say it uses the mailbox. It is filled only
|
|
244216
|
+
* while empty (a pick of the operator is never overwritten) and released only if this process
|
|
244217
|
+
* filled it. A hub integration carries no link: a stale one is cleared. With no default
|
|
244218
|
+
* resolved nothing is touched. False when the links could not be written.
|
|
243405
244219
|
*/
|
|
243406
|
-
async syncLinks(brokerId,
|
|
244220
|
+
async syncLinks(brokerId, defaultId, inUse) {
|
|
244221
|
+
if (defaultId === null) return true;
|
|
243407
244222
|
try {
|
|
243408
244223
|
const rows = await this.deps.links.list();
|
|
243409
|
-
for (const row of rows) {
|
|
243410
|
-
|
|
243411
|
-
|
|
243412
|
-
|
|
243413
|
-
|
|
243414
|
-
|
|
244224
|
+
for (const row of rows) if (row.id !== defaultId) {
|
|
244225
|
+
if (row.mailboxId !== "") await this.deps.links.set(row.id, "");
|
|
244226
|
+
} else if (inUse && row.mailboxId === "") {
|
|
244227
|
+
await this.deps.links.set(row.id, brokerId);
|
|
244228
|
+
this.filled.add(row.id);
|
|
244229
|
+
} else if (!inUse && this.filled.has(row.id) && row.mailboxId === brokerId) {
|
|
244230
|
+
await this.deps.links.set(row.id, "");
|
|
244231
|
+
this.filled.delete(row.id);
|
|
244232
|
+
}
|
|
244233
|
+
if (inUse && !rows.some((row) => row.id === defaultId)) this.deps.logger.warn("email-push: the default integration has no record to link the mailbox from", { meta: {
|
|
244234
|
+
integrationId: defaultId,
|
|
243415
244235
|
brokerId
|
|
243416
244236
|
} });
|
|
243417
244237
|
return true;
|
|
@@ -243550,7 +244370,7 @@ var EmailPushBridge = class {
|
|
|
243550
244370
|
*/
|
|
243551
244371
|
async buildCameraSetupParams(cam) {
|
|
243552
244372
|
if (!cam.isEmailPushEligible) return null;
|
|
243553
|
-
const brokerId = await this.
|
|
244373
|
+
const brokerId = await this.resolveMailbox();
|
|
243554
244374
|
const parsed = SmtpInboundConfigSchema.safeParse(await this.deps.port.getBrokerConfig(brokerId));
|
|
243555
244375
|
if (!parsed.success) throw new Error("The camera mailbox answered a configuration this build cannot read");
|
|
243556
244376
|
const config = parsed.data;
|
|
@@ -243572,6 +244392,60 @@ function pickMailbox(list) {
|
|
|
243572
244392
|
return list.find((b) => b.id === "smtp-inbound-default")?.id ?? list[0]?.id ?? null;
|
|
243573
244393
|
}
|
|
243574
244394
|
//#endregion
|
|
244395
|
+
//#region src/email-push-removal-hook.ts
|
|
244396
|
+
/**
|
|
244397
|
+
* A removed camera leaves its `cam-<stableId>` recipient in the mailbox (D865). The addon holds
|
|
244398
|
+
* no per-device DATA for the intake (the mailbox is owned by the mail addon), so removal only
|
|
244399
|
+
* redeclares the recipient set without the camera. Driven by the tombstone, never by absence.
|
|
244400
|
+
*/
|
|
244401
|
+
function createEmailPushRemovalHook(deps) {
|
|
244402
|
+
return {
|
|
244403
|
+
onDeviceRemoved: async () => {
|
|
244404
|
+
await deps.resync();
|
|
244405
|
+
return { counts: { "mailbox-recipients": 0 } };
|
|
244406
|
+
},
|
|
244407
|
+
listDeviceData: async () => []
|
|
244408
|
+
};
|
|
244409
|
+
}
|
|
244410
|
+
var LEGACY_PREFIX = "/webhook/";
|
|
244411
|
+
async function startLegacyWebhookIntake(deps) {
|
|
244412
|
+
const warned = /* @__PURE__ */ new Set();
|
|
244413
|
+
const server = createServer((req, res) => {
|
|
244414
|
+
const url = req.url ?? "";
|
|
244415
|
+
if (!url.startsWith(LEGACY_PREFIX)) {
|
|
244416
|
+
res.writeHead(404).end();
|
|
244417
|
+
return;
|
|
244418
|
+
}
|
|
244419
|
+
const rest = url.slice(8);
|
|
244420
|
+
req.url = rest;
|
|
244421
|
+
const id = decodeURIComponent(rest.replace(/^\//, "").split("?")[0] ?? "");
|
|
244422
|
+
const camera = deps.listCameras().find((c) => c.stableId === id);
|
|
244423
|
+
if (camera !== void 0 && !warned.has(id)) {
|
|
244424
|
+
warned.add(id);
|
|
244425
|
+
deps.logger.warn("legacy webhook port used — camera will be re-pointed", {
|
|
244426
|
+
tags: { deviceId: camera.id },
|
|
244427
|
+
meta: { port: deps.port ?? 9081 }
|
|
244428
|
+
});
|
|
244429
|
+
}
|
|
244430
|
+
Promise.resolve(deps.handler(req, res)).catch((err) => {
|
|
244431
|
+
deps.logger.error("legacy webhook intake failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
244432
|
+
if (!res.headersSent) res.writeHead(500);
|
|
244433
|
+
res.end();
|
|
244434
|
+
});
|
|
244435
|
+
});
|
|
244436
|
+
await new Promise((resolve, reject) => {
|
|
244437
|
+
server.once("error", reject);
|
|
244438
|
+
server.listen(deps.port ?? 9081, "0.0.0.0", () => {
|
|
244439
|
+
server.off("error", reject);
|
|
244440
|
+
resolve();
|
|
244441
|
+
});
|
|
244442
|
+
});
|
|
244443
|
+
return {
|
|
244444
|
+
server,
|
|
244445
|
+
close: () => new Promise((resolve) => server.close(() => resolve()))
|
|
244446
|
+
};
|
|
244447
|
+
}
|
|
244448
|
+
//#endregion
|
|
243575
244449
|
//#region src/reolink-connection-test.ts
|
|
243576
244450
|
/**
|
|
243577
244451
|
* The Reolink NVR / Home Hub connection test (planning#581): log in over Baichuan with the
|
|
@@ -243679,6 +244553,28 @@ var reolinkConnectionsEntryKind = defineEntryKind("connections", {
|
|
|
243679
244553
|
}),
|
|
243680
244554
|
writeTrigger: "an operator adds, edits or removes a Reolink integration"
|
|
243681
244555
|
});
|
|
244556
|
+
/** The kind of the default integration (standalone cameras): a name and the mailbox link, no Test. */
|
|
244557
|
+
var REOLINK_DEFAULT_KIND = "default";
|
|
244558
|
+
/** The kind of an NVR / Home Hub integration: its connection, with a Test. */
|
|
244559
|
+
var REOLINK_HUB_KIND = "connection";
|
|
244560
|
+
/** The form of the default integration: which camera mailbox its standalone cameras use. */
|
|
244561
|
+
function buildDefaultInstanceSchema() {
|
|
244562
|
+
return { sections: [{
|
|
244563
|
+
id: "mailbox",
|
|
244564
|
+
title: "Camera mailbox",
|
|
244565
|
+
titleKey: "provider-reolink:connection.s_mailbox.title",
|
|
244566
|
+
description: "The mailbox the standalone cameras send their email push to.",
|
|
244567
|
+
descriptionKey: "provider-reolink:connection.s_mailbox.description",
|
|
244568
|
+
columns: 1,
|
|
244569
|
+
fields: [{
|
|
244570
|
+
...linkFieldDescriptor(MAILBOX_LINK_FIELD, SMTP_MAILBOX_LINK, {
|
|
244571
|
+
label: "Camera mailbox",
|
|
244572
|
+
required: false
|
|
244573
|
+
}),
|
|
244574
|
+
labelKey: "provider-reolink:connection.s_mailbox.mailboxId.label"
|
|
244575
|
+
}]
|
|
244576
|
+
}] };
|
|
244577
|
+
}
|
|
243682
244578
|
/** Every kind this addon declares, keyed by its name. */
|
|
243683
244579
|
var reolinkRecordKinds = { connections: reolinkConnectionsEntryKind };
|
|
243684
244580
|
/**
|
|
@@ -243785,12 +244681,26 @@ function buildReolinkInstances(records, deps) {
|
|
|
243785
244681
|
kind: "connection",
|
|
243786
244682
|
canTest: true,
|
|
243787
244683
|
kinds: [{
|
|
243788
|
-
id:
|
|
243789
|
-
label: "Reolink",
|
|
244684
|
+
id: REOLINK_DEFAULT_KIND,
|
|
244685
|
+
label: "Reolink standalone cameras",
|
|
243790
244686
|
functionCap: "device-provider",
|
|
243791
|
-
role: "devices"
|
|
244687
|
+
role: "devices",
|
|
244688
|
+
canTest: false,
|
|
244689
|
+
creatable: false
|
|
244690
|
+
}, {
|
|
244691
|
+
id: REOLINK_HUB_KIND,
|
|
244692
|
+
label: "Reolink NVR / Home Hub",
|
|
244693
|
+
functionCap: "device-provider",
|
|
244694
|
+
role: "devices",
|
|
244695
|
+
canTest: true
|
|
244696
|
+
}],
|
|
244697
|
+
links: [{
|
|
244698
|
+
kind: REOLINK_DEFAULT_KIND,
|
|
244699
|
+
field: MAILBOX_LINK_FIELD,
|
|
244700
|
+
to: SMTP_MAILBOX_LINK
|
|
243792
244701
|
}]
|
|
243793
244702
|
},
|
|
244703
|
+
kindOf: () => REOLINK_HUB_KIND,
|
|
243794
244704
|
formSchema: () => buildHubInstanceSchema(),
|
|
243795
244705
|
initialBody: (name) => ({ name }),
|
|
243796
244706
|
configured: (body) => (body.host ?? "").length === 0 || (body.password ?? "").length > 0,
|
|
@@ -243804,10 +244714,15 @@ function buildReolinkInstances(records, deps) {
|
|
|
243804
244714
|
*/
|
|
243805
244715
|
function reolinkInstancesProvider(instances, deps) {
|
|
243806
244716
|
const base = instances.toProvider();
|
|
243807
|
-
const withAddDevice = async (instance) =>
|
|
243808
|
-
|
|
243809
|
-
|
|
243810
|
-
|
|
244717
|
+
const withAddDevice = async (instance) => {
|
|
244718
|
+
const isHub = await integrationIsHubCached(instances, deps.evidenceCache, instance.id);
|
|
244719
|
+
const known = deps.evidenceCache.get(instance.id) !== null;
|
|
244720
|
+
return {
|
|
244721
|
+
...instance,
|
|
244722
|
+
kind: known && !isHub ? REOLINK_DEFAULT_KIND : REOLINK_HUB_KIND,
|
|
244723
|
+
addDevice: isHub ? "children" : "scan"
|
|
244724
|
+
};
|
|
244725
|
+
};
|
|
243811
244726
|
return {
|
|
243812
244727
|
...base,
|
|
243813
244728
|
listInstances: async (input) => Promise.all((await base.listInstances(input)).map(withAddDevice)),
|
|
@@ -243823,7 +244738,7 @@ function reolinkInstancesProvider(instances, deps) {
|
|
|
243823
244738
|
originStableId: evidence.originStableId,
|
|
243824
244739
|
info: evidence.info,
|
|
243825
244740
|
settings: body === null ? {} : hubSettingsOf(body)
|
|
243826
|
-
}) || body === null ? buildHubInstanceSchema() :
|
|
244741
|
+
}) || body === null ? buildHubInstanceSchema() : buildDefaultInstanceSchema();
|
|
243827
244742
|
}
|
|
243828
244743
|
};
|
|
243829
244744
|
}
|
|
@@ -243875,60 +244790,6 @@ function mailboxLinkStoreOver(records) {
|
|
|
243875
244790
|
};
|
|
243876
244791
|
}
|
|
243877
244792
|
//#endregion
|
|
243878
|
-
//#region src/email-push-removal-hook.ts
|
|
243879
|
-
/**
|
|
243880
|
-
* A removed camera leaves its `cam-<stableId>` recipient in the mailbox (D865). The addon holds
|
|
243881
|
-
* no per-device DATA for the intake (the mailbox is owned by the mail addon), so removal only
|
|
243882
|
-
* redeclares the recipient set without the camera. Driven by the tombstone, never by absence.
|
|
243883
|
-
*/
|
|
243884
|
-
function createEmailPushRemovalHook(deps) {
|
|
243885
|
-
return {
|
|
243886
|
-
onDeviceRemoved: async () => {
|
|
243887
|
-
await deps.resync();
|
|
243888
|
-
return { counts: { "mailbox-recipients": 0 } };
|
|
243889
|
-
},
|
|
243890
|
-
listDeviceData: async () => []
|
|
243891
|
-
};
|
|
243892
|
-
}
|
|
243893
|
-
var LEGACY_PREFIX = "/webhook/";
|
|
243894
|
-
async function startLegacyWebhookIntake(deps) {
|
|
243895
|
-
const warned = /* @__PURE__ */ new Set();
|
|
243896
|
-
const server = createServer((req, res) => {
|
|
243897
|
-
const url = req.url ?? "";
|
|
243898
|
-
if (!url.startsWith(LEGACY_PREFIX)) {
|
|
243899
|
-
res.writeHead(404).end();
|
|
243900
|
-
return;
|
|
243901
|
-
}
|
|
243902
|
-
const rest = url.slice(8);
|
|
243903
|
-
req.url = rest;
|
|
243904
|
-
const id = decodeURIComponent(rest.replace(/^\//, "").split("?")[0] ?? "");
|
|
243905
|
-
const camera = deps.listCameras().find((c) => c.stableId === id);
|
|
243906
|
-
if (camera !== void 0 && !warned.has(id)) {
|
|
243907
|
-
warned.add(id);
|
|
243908
|
-
deps.logger.warn("legacy webhook port used — camera will be re-pointed", {
|
|
243909
|
-
tags: { deviceId: camera.id },
|
|
243910
|
-
meta: { port: deps.port ?? 9081 }
|
|
243911
|
-
});
|
|
243912
|
-
}
|
|
243913
|
-
Promise.resolve(deps.handler(req, res)).catch((err) => {
|
|
243914
|
-
deps.logger.error("legacy webhook intake failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
243915
|
-
if (!res.headersSent) res.writeHead(500);
|
|
243916
|
-
res.end();
|
|
243917
|
-
});
|
|
243918
|
-
});
|
|
243919
|
-
await new Promise((resolve, reject) => {
|
|
243920
|
-
server.once("error", reject);
|
|
243921
|
-
server.listen(deps.port ?? 9081, "0.0.0.0", () => {
|
|
243922
|
-
server.off("error", reject);
|
|
243923
|
-
resolve();
|
|
243924
|
-
});
|
|
243925
|
-
});
|
|
243926
|
-
return {
|
|
243927
|
-
server,
|
|
243928
|
-
close: () => new Promise((resolve) => server.close(() => resolve()))
|
|
243929
|
-
};
|
|
243930
|
-
}
|
|
243931
|
-
//#endregion
|
|
243932
244793
|
//#region src/migrations/drop-webhook-intake-settings.ts
|
|
243933
244794
|
/**
|
|
243934
244795
|
* The camera webhook is a plane of the addon's HTTP data plane, not a private listener
|
|
@@ -244149,6 +245010,14 @@ var REOLINK_MIGRATIONS = [{
|
|
|
244149
245010
|
},
|
|
244150
245011
|
plan: planDropWebhookIntakeSettings
|
|
244151
245012
|
}];
|
|
245013
|
+
/** The date of the device claim (D1007). */
|
|
245014
|
+
var CLAIM_DEVICES_DATE = "2026-11-04";
|
|
245015
|
+
/**
|
|
245016
|
+
* Every persisted camera that names no integration is claimed to the addon's default one. The
|
|
245017
|
+
* integration a hub migration created is never the default, so it is not eligible. The integration
|
|
245018
|
+
* settings themselves stay where they are until this addon's own wave moves them.
|
|
245019
|
+
*/
|
|
245020
|
+
var REOLINK_CLAIM_ELIGIBLE = (integration) => integration.info[MIGRATED_FROM_HUB_KEY] === void 0;
|
|
244152
245021
|
/**
|
|
244153
245022
|
* The integration wave (D1007) in declaration order, which must follow `seq`: the device claim
|
|
244154
245023
|
* shipped first (seq 3) and the rows move follows it (seq 4). The engine refuses the whole
|
|
@@ -244156,10 +245025,10 @@ var REOLINK_MIGRATIONS = [{
|
|
|
244156
245025
|
*/
|
|
244157
245026
|
var REOLINK_INTEGRATION_MIGRATIONS = [claimDevicesMigration({
|
|
244158
245027
|
addonId: "provider-reolink",
|
|
244159
|
-
date:
|
|
245028
|
+
date: CLAIM_DEVICES_DATE,
|
|
244160
245029
|
seq: 3,
|
|
244161
245030
|
dependsOn: [],
|
|
244162
|
-
eligible:
|
|
245031
|
+
eligible: REOLINK_CLAIM_ELIGIBLE
|
|
244163
245032
|
}), REOLINK_ROWS_TO_RECORD_MIGRATION];
|
|
244164
245033
|
//#endregion
|
|
244165
245034
|
//#region src/reolink-adoption-provider.ts
|
|
@@ -245011,12 +245880,24 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
245011
245880
|
if (records === void 0) throw new Error("provider-reolink: ctx.records is required (hub-only addon)");
|
|
245012
245881
|
return records;
|
|
245013
245882
|
}
|
|
245883
|
+
/**
|
|
245884
|
+
* The registry id of the default integration (standalone cameras): the lowest-numbered one this
|
|
245885
|
+
* addon owns that no hub migration created, the same rule as the device claim (D1007).
|
|
245886
|
+
*/
|
|
245887
|
+
async resolveDefaultIntegrationId() {
|
|
245888
|
+
return defaultIntegrationOf((await this.ctx.api.integrations.list.query()).filter((i) => i.addonId === this.ctx.id).map((i) => ({
|
|
245889
|
+
id: i.id,
|
|
245890
|
+
name: i.name,
|
|
245891
|
+
info: { ...i.info }
|
|
245892
|
+
})), REOLINK_CLAIM_ELIGIBLE)?.id ?? null;
|
|
245893
|
+
}
|
|
245014
245894
|
/** The camera mailbox bridge, built once. */
|
|
245015
245895
|
ensureEmailBridge() {
|
|
245016
245896
|
this.emailBridge ??= new EmailPushBridge({
|
|
245017
245897
|
port: createBrokerPort(this.ctx.api),
|
|
245018
245898
|
links: mailboxLinkStoreOver(this.requireRecords()),
|
|
245019
245899
|
listCameras: () => this.listReolinkCameras(),
|
|
245900
|
+
defaultIntegrationId: () => this.resolveDefaultIntegrationId(),
|
|
245020
245901
|
logger: this.ctx.logger.child("email-push"),
|
|
245021
245902
|
pending: {
|
|
245022
245903
|
read: () => this.readPendingMailbox(),
|