@camstack/addon-provider-reolink 1.2.251 → 1.2.253

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/addon.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-C0PIVXwH.mjs
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
- value: unknown(),
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. */
@@ -129602,6 +130262,16 @@ var RecordingBandTriggersSchema = RecordingTriggersSchema;
129602
130262
  * question to answer as a continuous one.
129603
130263
  */
129604
130264
  var RecordingBandAudioSchema = _enum(["on", "muted"]);
130265
+ /**
130266
+ * A battery condition on a band: the band covers a charge level only when
130267
+ * `min <= level < max` (half-open; a missing bound is unbounded). OPTIONAL —
130268
+ * an absent key means "any charge", which is what every config written before
130269
+ * it meant. A band WITH a condition is never met while the charge is unknown.
130270
+ */
130271
+ var RecordingBandBatterySchema = object({
130272
+ min: number$1().min(0).max(100).optional(),
130273
+ max: number$1().min(0).max(100).optional()
130274
+ });
129605
130275
  var RecordingBandSchema = object({
129606
130276
  days: array(RecordingWeekdaySchema),
129607
130277
  start: string().regex(HHMM),
@@ -129613,6 +130283,7 @@ var RecordingBandSchema = object({
129613
130283
  * missing must keep meaning what it meant. See {@link RecordingBandAudioSchema}.
129614
130284
  */
129615
130285
  audio: RecordingBandAudioSchema.optional(),
130286
+ battery: RecordingBandBatterySchema.optional(),
129616
130287
  triggers: RecordingBandTriggersSchema.optional(),
129617
130288
  /**
129618
130289
  * RETIRED (D381). A band no longer carries a pre-buffer of its own.
@@ -162517,7 +163188,7 @@ var HISTORY_PRIMARY = {
162517
163188
  }
162518
163189
  };
162519
163190
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
162520
- var PowerSourceRefusalReasonSchema = _enum([
163191
+ var PowerSourceRefusalReasonSchema$1 = _enum([
162521
163192
  "no-power-source",
162522
163193
  "switch-missing",
162523
163194
  "switch-offline",
@@ -162532,7 +163203,7 @@ var PowerSourceRefusalReasonSchema = _enum([
162532
163203
  ]);
162533
163204
  var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
162534
163205
  accepted: literal(false),
162535
- reason: PowerSourceRefusalReasonSchema,
163206
+ reason: PowerSourceRefusalReasonSchema$1,
162536
163207
  /** One line for the operator, naming the switch. */
162537
163208
  message: string()
162538
163209
  })]);
@@ -186817,6 +187488,7 @@ var HardwareClassIdSchema = _enum([
186817
187488
  "apple-m-base",
186818
187489
  "apple-m-pro",
186819
187490
  "amd-phoenix",
187491
+ "nvidia-gpu",
186820
187492
  "unknown"
186821
187493
  ]);
186822
187494
  var AcceleratorKindSchema = _enum([
@@ -186824,6 +187496,7 @@ var AcceleratorKindSchema = _enum([
186824
187496
  "intel-igpu",
186825
187497
  "amd-igpu",
186826
187498
  "amd-npu",
187499
+ "nvidia-gpu",
186827
187500
  "x86-cpu",
186828
187501
  "arm-cpu",
186829
187502
  "apple-ane",
@@ -228563,46 +229236,6 @@ var IntercomFailureReport = class {
228563
229236
  /** The process-wide instance every camera in this addon notes into. */
228564
229237
  var intercomFailureReport = new IntercomFailureReport();
228565
229238
  //#endregion
228566
- //#region src/clips/clip-time-zone.ts
228567
- function isUsableTimeZone(timeZone) {
228568
- try {
228569
- new Intl.DateTimeFormat("en-US", { timeZone });
228570
- return true;
228571
- } catch {
228572
- return false;
228573
- }
228574
- }
228575
- /**
228576
- * @param candidate the zone the process reports
228577
- * @param cameraZone a zone derived from the camera's reported UTC offset, if any
228578
- */
228579
- function resolveClipTimeZone(candidate, cameraZone) {
228580
- if (isUsableTimeZone(candidate)) return { timeZone: candidate };
228581
- if (cameraZone !== void 0 && isUsableTimeZone(cameraZone)) return {
228582
- timeZone: cameraZone,
228583
- rejected: candidate
228584
- };
228585
- return {
228586
- timeZone: "UTC",
228587
- rejected: candidate
228588
- };
228589
- }
228590
- /** Resolve and, when the candidate was refused, warn ONCE per `warned` holder. */
228591
- function resolveClipTimeZoneOnce(candidate, cameraZone, logger, deviceId, warned) {
228592
- const res = resolveClipTimeZone(candidate, cameraZone);
228593
- if (res.rejected !== void 0 && !warned.done) {
228594
- warned.done = true;
228595
- logger.warn("clip catalog: the process time zone is not usable, using a fallback", {
228596
- tags: { deviceId },
228597
- meta: {
228598
- rejectedTimeZone: res.rejected,
228599
- fallbackTimeZone: res.timeZone
228600
- }
228601
- });
228602
- }
228603
- return res.timeZone;
228604
- }
228605
- //#endregion
228606
229239
  //#region src/baichuan-webhook-shared.ts
228607
229240
  /** The data-plane prefix this addon serves the camera push on: `/addon/<addonId>/webhook/<stableId>`. */
228608
229241
  var BAICHUAN_WEBHOOK_PREFIX = "webhook";
@@ -229002,6 +229635,46 @@ async function refreshSnapshotCacheOnce(input) {
229002
229635
  return true;
229003
229636
  }
229004
229637
  //#endregion
229638
+ //#region src/clips/clip-time-zone.ts
229639
+ function isUsableTimeZone(timeZone) {
229640
+ try {
229641
+ new Intl.DateTimeFormat("en-US", { timeZone });
229642
+ return true;
229643
+ } catch {
229644
+ return false;
229645
+ }
229646
+ }
229647
+ /**
229648
+ * @param candidate the zone the process reports
229649
+ * @param cameraZone a zone derived from the camera's reported UTC offset, if any
229650
+ */
229651
+ function resolveClipTimeZone(candidate, cameraZone) {
229652
+ if (isUsableTimeZone(candidate)) return { timeZone: candidate };
229653
+ if (cameraZone !== void 0 && isUsableTimeZone(cameraZone)) return {
229654
+ timeZone: cameraZone,
229655
+ rejected: candidate
229656
+ };
229657
+ return {
229658
+ timeZone: "UTC",
229659
+ rejected: candidate
229660
+ };
229661
+ }
229662
+ /** Resolve and, when the candidate was refused, warn ONCE per `warned` holder. */
229663
+ function resolveClipTimeZoneOnce(candidate, cameraZone, logger, deviceId, warned) {
229664
+ const res = resolveClipTimeZone(candidate, cameraZone);
229665
+ if (res.rejected !== void 0 && !warned.done) {
229666
+ warned.done = true;
229667
+ logger.warn("clip catalog: the process time zone is not usable, using a fallback", {
229668
+ tags: { deviceId },
229669
+ meta: {
229670
+ rejectedTimeZone: res.rejected,
229671
+ fallbackTimeZone: res.timeZone
229672
+ }
229673
+ });
229674
+ }
229675
+ return res.timeZone;
229676
+ }
229677
+ //#endregion
229005
229678
  //#region src/day-night-mapping.ts
229006
229679
  /**
229007
229680
  * Maps between the vendor-neutral `day-night` cap's `DayNightMode` and
@@ -229104,6 +229777,114 @@ function deriveReolinkCameraFeatures(inputs) {
229104
229777
  return out;
229105
229778
  }
229106
229779
  //#endregion
229780
+ //#region src/hub-child-settings.ts
229781
+ /**
229782
+ * A camera adopted under an NVR / Home Hub dials through the integration's session: the address
229783
+ * and the credentials belong to the integration, never to the camera. These are the per-camera
229784
+ * keys a hub child must refuse to change.
229785
+ */
229786
+ var HUB_CHILD_CONNECTION_KEYS = [
229787
+ "host",
229788
+ "port",
229789
+ "username",
229790
+ "password"
229791
+ ];
229792
+ /**
229793
+ * Sections that act on the hub itself (no channel in the call) or on the per-camera connection,
229794
+ * hidden for a hub child:
229795
+ * - `connection`: the per-camera address and credentials (the integration owns them);
229796
+ * - `network-ports`: `setPortConfig` rewrites the NVR's own service ports;
229797
+ * - `time-ntp`: `setNtp` / `setSystemGeneral` / `setDst` rewrite the NVR's clock.
229798
+ */
229799
+ var HUB_CHILD_HIDDEN_SECTION_IDS = [
229800
+ "connection",
229801
+ "network-ports",
229802
+ "time-ntp"
229803
+ ];
229804
+ /** Thrown by `applySettingsPatch` for a refused hub-child patch; carries the typed reason. */
229805
+ var HubChildPatchRefusedError = class extends Error {
229806
+ refusal;
229807
+ constructor(refusal) {
229808
+ super(describeRefusal(refusal));
229809
+ this.refusal = refusal;
229810
+ this.name = "HubChildPatchRefusedError";
229811
+ }
229812
+ };
229813
+ function describeRefusal(refusal) {
229814
+ switch (refusal.reason) {
229815
+ case "connection-owned-by-integration": return `This camera is connected through its NVR / Home Hub integration: ${refusal.keys.join(", ")} can only be changed on the integration`;
229816
+ case "channel-not-an-integer": return `The hub channel must be a whole number, got ${String(refusal.value)}`;
229817
+ case "channel-out-of-range": return `Channel ${refusal.value} is not one of the hub's channels (${refusal.channels.join(", ")})`;
229818
+ }
229819
+ }
229820
+ /**
229821
+ * Judge a settings patch against the hub-child rules. `channels` is the hub's last good channel
229822
+ * list (empty when unknown — then only the integer rule applies).
229823
+ */
229824
+ function judgeHubChildPatch(patch, channels) {
229825
+ const touched = HUB_CHILD_CONNECTION_KEYS.filter((k) => patch[k] !== void 0);
229826
+ if (touched.length > 0) return {
229827
+ reason: "connection-owned-by-integration",
229828
+ keys: touched
229829
+ };
229830
+ if (patch["channel"] === void 0) return null;
229831
+ const value = patch["channel"];
229832
+ if (typeof value !== "number" || !Number.isInteger(value) || value < 0) return {
229833
+ reason: "channel-not-an-integer",
229834
+ value
229835
+ };
229836
+ if (channels.length > 0 && !channels.includes(value)) return {
229837
+ reason: "channel-out-of-range",
229838
+ value,
229839
+ channels
229840
+ };
229841
+ return null;
229842
+ }
229843
+ /** What a hub child shows before its session has read the hub's channel list. */
229844
+ var EMPTY_HUB_CHANNEL_SNAPSHOT = {
229845
+ channels: [],
229846
+ lastRefreshAt: null,
229847
+ lastError: null
229848
+ };
229849
+ /** The hub-child "Hub" section: which hub, and the one editable connection field, the channel. */
229850
+ function buildHubChildSection(snapshot) {
229851
+ return {
229852
+ id: "hub",
229853
+ tab: "general",
229854
+ title: "Hub",
229855
+ titleKey: "provider-reolink:schema.s_hub.title",
229856
+ description: "This camera is connected through its NVR / Home Hub. Address and credentials belong to that integration; the channel is kept in line with the hub automatically.",
229857
+ descriptionKey: "provider-reolink:schema.s_hub.description",
229858
+ columns: 2,
229859
+ fields: [{
229860
+ type: "text",
229861
+ key: "hubName",
229862
+ label: "Connected to",
229863
+ labelKey: "provider-reolink:schema.s_hub.hubName.label",
229864
+ disabled: true
229865
+ }, {
229866
+ type: "number",
229867
+ key: "channel",
229868
+ label: "Hub channel",
229869
+ labelKey: "provider-reolink:schema.s_hub.channel.label",
229870
+ min: 0,
229871
+ ...snapshot.channels.length > 0 ? { max: Math.max(...snapshot.channels.map((c) => c.channel)) } : {},
229872
+ step: 1
229873
+ }]
229874
+ };
229875
+ }
229876
+ /** Replace the connection/hub-acting sections of a standalone schema with the Hub section. */
229877
+ function applyHubChildSections(sections, snapshot) {
229878
+ const kept = sections.filter((s) => !HUB_CHILD_HIDDEN_SECTION_IDS.includes(s.id));
229879
+ const at = kept.findIndex((s) => s.id === "driver-refresh");
229880
+ const hub = buildHubChildSection(snapshot);
229881
+ return at < 0 ? [hub, ...kept] : [
229882
+ ...kept.slice(0, at + 1),
229883
+ hub,
229884
+ ...kept.slice(at + 1)
229885
+ ];
229886
+ }
229887
+ //#endregion
229107
229888
  //#region src/image-settings-mapping.ts
229108
229889
  /**
229109
229890
  * Reolink's `InputAdvanceCfg.Exposure.mode` (Baichuan cmdId 25/26, via
@@ -230890,114 +231671,6 @@ function registerHubChildStateRefresh(target) {
230890
231671
  }, { stateRefresh: hubChildRefreshPolicy(integrationId) });
230891
231672
  }
230892
231673
  //#endregion
230893
- //#region src/hub-child-settings.ts
230894
- /**
230895
- * A camera adopted under an NVR / Home Hub dials through the integration's session: the address
230896
- * and the credentials belong to the integration, never to the camera. These are the per-camera
230897
- * keys a hub child must refuse to change.
230898
- */
230899
- var HUB_CHILD_CONNECTION_KEYS = [
230900
- "host",
230901
- "port",
230902
- "username",
230903
- "password"
230904
- ];
230905
- /**
230906
- * Sections that act on the hub itself (no channel in the call) or on the per-camera connection,
230907
- * hidden for a hub child:
230908
- * - `connection`: the per-camera address and credentials (the integration owns them);
230909
- * - `network-ports`: `setPortConfig` rewrites the NVR's own service ports;
230910
- * - `time-ntp`: `setNtp` / `setSystemGeneral` / `setDst` rewrite the NVR's clock.
230911
- */
230912
- var HUB_CHILD_HIDDEN_SECTION_IDS = [
230913
- "connection",
230914
- "network-ports",
230915
- "time-ntp"
230916
- ];
230917
- /** Thrown by `applySettingsPatch` for a refused hub-child patch; carries the typed reason. */
230918
- var HubChildPatchRefusedError = class extends Error {
230919
- refusal;
230920
- constructor(refusal) {
230921
- super(describeRefusal(refusal));
230922
- this.refusal = refusal;
230923
- this.name = "HubChildPatchRefusedError";
230924
- }
230925
- };
230926
- function describeRefusal(refusal) {
230927
- switch (refusal.reason) {
230928
- case "connection-owned-by-integration": return `This camera is connected through its NVR / Home Hub integration: ${refusal.keys.join(", ")} can only be changed on the integration`;
230929
- case "channel-not-an-integer": return `The hub channel must be a whole number, got ${String(refusal.value)}`;
230930
- case "channel-out-of-range": return `Channel ${refusal.value} is not one of the hub's channels (${refusal.channels.join(", ")})`;
230931
- }
230932
- }
230933
- /**
230934
- * Judge a settings patch against the hub-child rules. `channels` is the hub's last good channel
230935
- * list (empty when unknown — then only the integer rule applies).
230936
- */
230937
- function judgeHubChildPatch(patch, channels) {
230938
- const touched = HUB_CHILD_CONNECTION_KEYS.filter((k) => patch[k] !== void 0);
230939
- if (touched.length > 0) return {
230940
- reason: "connection-owned-by-integration",
230941
- keys: touched
230942
- };
230943
- if (patch["channel"] === void 0) return null;
230944
- const value = patch["channel"];
230945
- if (typeof value !== "number" || !Number.isInteger(value) || value < 0) return {
230946
- reason: "channel-not-an-integer",
230947
- value
230948
- };
230949
- if (channels.length > 0 && !channels.includes(value)) return {
230950
- reason: "channel-out-of-range",
230951
- value,
230952
- channels
230953
- };
230954
- return null;
230955
- }
230956
- /** What a hub child shows before its session has read the hub's channel list. */
230957
- var EMPTY_HUB_CHANNEL_SNAPSHOT = {
230958
- channels: [],
230959
- lastRefreshAt: null,
230960
- lastError: null
230961
- };
230962
- /** The hub-child "Hub" section: which hub, and the one editable connection field, the channel. */
230963
- function buildHubChildSection(snapshot) {
230964
- return {
230965
- id: "hub",
230966
- tab: "general",
230967
- title: "Hub",
230968
- titleKey: "provider-reolink:schema.s_hub.title",
230969
- description: "This camera is connected through its NVR / Home Hub. Address and credentials belong to that integration; the channel is kept in line with the hub automatically.",
230970
- descriptionKey: "provider-reolink:schema.s_hub.description",
230971
- columns: 2,
230972
- fields: [{
230973
- type: "text",
230974
- key: "hubName",
230975
- label: "Connected to",
230976
- labelKey: "provider-reolink:schema.s_hub.hubName.label",
230977
- disabled: true
230978
- }, {
230979
- type: "number",
230980
- key: "channel",
230981
- label: "Hub channel",
230982
- labelKey: "provider-reolink:schema.s_hub.channel.label",
230983
- min: 0,
230984
- ...snapshot.channels.length > 0 ? { max: Math.max(...snapshot.channels.map((c) => c.channel)) } : {},
230985
- step: 1
230986
- }]
230987
- };
230988
- }
230989
- /** Replace the connection/hub-acting sections of a standalone schema with the Hub section. */
230990
- function applyHubChildSections(sections, snapshot) {
230991
- const kept = sections.filter((s) => !HUB_CHILD_HIDDEN_SECTION_IDS.includes(s.id));
230992
- const at = kept.findIndex((s) => s.id === "driver-refresh");
230993
- const hub = buildHubChildSection(snapshot);
230994
- return at < 0 ? [hub, ...kept] : [
230995
- ...kept.slice(0, at + 1),
230996
- hub,
230997
- ...kept.slice(at + 1)
230998
- ];
230999
- }
231000
- //#endregion
231001
231674
  //#region src/sleep-state-decision.ts
231002
231675
  /**
231003
231676
  * Hysteresis is ASYMMETRIC, because the two directions have very different
@@ -233625,6 +234298,160 @@ function buildSupportedNativeClasses(aiDetectTypes, isSupportedClass) {
233625
234298
  }
233626
234299
  return classes;
233627
234300
  }
234301
+ var PowerSourceModeSchema = _enum(["adapter", "battery"]);
234302
+ /** What a read says: a mode, or `unknown` when the read failed or the firmware is silent. */
234303
+ var PowerSourceReadingSchema = _enum([
234304
+ "adapter",
234305
+ "battery",
234306
+ "unknown"
234307
+ ]);
234308
+ var ReadPowerSourceResultSchema = object({ source: PowerSourceReadingSchema });
234309
+ /** The device (or this code) declined before any real write was sent. */
234310
+ var PowerSourceRefusalReasonSchema = _enum(["dry-run-refused", "dry-run-failed"]);
234311
+ var SwitchPowerSourceResultSchema = discriminatedUnion("outcome", [
234312
+ object({
234313
+ outcome: literal("refused"),
234314
+ mode: PowerSourceModeSchema,
234315
+ reason: PowerSourceRefusalReasonSchema,
234316
+ before: PowerSourceReadingSchema
234317
+ }),
234318
+ object({
234319
+ outcome: literal("sent"),
234320
+ mode: PowerSourceModeSchema,
234321
+ /** The firmware accepted the command. NOT proof it took effect. */
234322
+ accepted: boolean(),
234323
+ before: PowerSourceReadingSchema,
234324
+ after: PowerSourceReadingSchema,
234325
+ /** True only when the read-back after the write equals the requested mode. */
234326
+ applied: boolean()
234327
+ }),
234328
+ object({
234329
+ outcome: literal("failed"),
234330
+ mode: PowerSourceModeSchema,
234331
+ /** The real write threw. It was sent once and is not retried. */
234332
+ error: string(),
234333
+ before: PowerSourceReadingSchema
234334
+ })
234335
+ ]);
234336
+ function errorMessage(error) {
234337
+ return error instanceof Error ? error.message : String(error);
234338
+ }
234339
+ /** Read the power source; a failed or silent read is `unknown`. */
234340
+ async function readPowerSource(target) {
234341
+ const { api, channel, deviceId, logger } = target;
234342
+ try {
234343
+ const mode = await api.getPowerSource(channel);
234344
+ if (mode === void 0) {
234345
+ logger.info("power source: the firmware does not report it", {
234346
+ tags: { deviceId },
234347
+ meta: { channel }
234348
+ });
234349
+ return "unknown";
234350
+ }
234351
+ return mode;
234352
+ } catch (error) {
234353
+ logger.warn("power source: read failed, reporting unknown", {
234354
+ tags: { deviceId },
234355
+ meta: {
234356
+ channel,
234357
+ error: errorMessage(error)
234358
+ }
234359
+ });
234360
+ return "unknown";
234361
+ }
234362
+ }
234363
+ /**
234364
+ * Switch the power source: read, dry run, one real write, read back.
234365
+ * The write is sent at most once and never retried.
234366
+ */
234367
+ async function switchPowerSourceTo(target, mode) {
234368
+ const { api, channel, deviceId, logger } = target;
234369
+ const before = await readPowerSource(target);
234370
+ logger.info("power source: switch requested", {
234371
+ tags: { deviceId },
234372
+ meta: {
234373
+ mode,
234374
+ before,
234375
+ channel
234376
+ }
234377
+ });
234378
+ let supported;
234379
+ try {
234380
+ supported = await api.probePowerSourceSwitchSupport(mode, { channel });
234381
+ } catch (error) {
234382
+ logger.warn("power source: dry run failed, no switch sent", {
234383
+ tags: { deviceId },
234384
+ meta: {
234385
+ mode,
234386
+ error: errorMessage(error)
234387
+ }
234388
+ });
234389
+ return {
234390
+ outcome: "refused",
234391
+ mode,
234392
+ reason: "dry-run-failed",
234393
+ before
234394
+ };
234395
+ }
234396
+ if (!supported) {
234397
+ logger.warn("power source: the device refused the dry run, no switch sent", {
234398
+ tags: { deviceId },
234399
+ meta: {
234400
+ mode,
234401
+ before
234402
+ }
234403
+ });
234404
+ return {
234405
+ outcome: "refused",
234406
+ mode,
234407
+ reason: "dry-run-refused",
234408
+ before
234409
+ };
234410
+ }
234411
+ let result;
234412
+ try {
234413
+ result = await api.switchPowerSource(mode, { channel });
234414
+ } catch (error) {
234415
+ logger.error("power source: the switch threw; it is not retried", {
234416
+ tags: { deviceId },
234417
+ meta: {
234418
+ mode,
234419
+ error: errorMessage(error)
234420
+ }
234421
+ });
234422
+ return {
234423
+ outcome: "failed",
234424
+ mode,
234425
+ error: errorMessage(error),
234426
+ before
234427
+ };
234428
+ }
234429
+ const after = await readPowerSource(target);
234430
+ const applied = result.accepted && after === mode;
234431
+ const meta = {
234432
+ mode,
234433
+ before,
234434
+ after,
234435
+ accepted: result.accepted,
234436
+ rspCode: result.rspCode
234437
+ };
234438
+ if (applied) logger.info("power source: switched", {
234439
+ tags: { deviceId },
234440
+ meta
234441
+ });
234442
+ else logger.warn("power source: the switch was sent but the read-back does not show it", {
234443
+ tags: { deviceId },
234444
+ meta
234445
+ });
234446
+ return {
234447
+ outcome: "sent",
234448
+ mode,
234449
+ accepted: result.accepted,
234450
+ before,
234451
+ after,
234452
+ applied
234453
+ };
234454
+ }
233628
234455
  //#endregion
233629
234456
  //#region src/ptz-zoom.ts
233630
234457
  /**
@@ -234614,6 +235441,8 @@ var RefreshSettingsResultSchema = object({
234614
235441
  capsWarmed: number$1(),
234615
235442
  capsTotal: number$1()
234616
235443
  });
235444
+ /** The two switch actions, one implementation each way. */
235445
+ var POWER_SWITCH_ACTIONS = [["switch-to-wired-power", "adapter"], ["switch-to-battery-power", "battery"]];
234617
235446
  /** The uid out of a device's metadata bag, or nothing. Never a cast. */
234618
235447
  function metaUid(metadata) {
234619
235448
  if (metadata === null) return void 0;
@@ -235999,6 +236828,16 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
235999
236828
  capsTotal
236000
236829
  };
236001
236830
  });
236831
+ if (this.isBattery) {
236832
+ this.registerDeviceAction("read-power-source", deviceCustomAction(unknown(), ReadPowerSourceResultSchema, { kind: "mutation" }), async () => {
236833
+ await this.wakeIfSleeping();
236834
+ return { source: await readPowerSource(await this.powerSourceTarget()) };
236835
+ });
236836
+ for (const [action, mode] of POWER_SWITCH_ACTIONS) this.registerDeviceAction(action, deviceCustomAction(unknown(), SwitchPowerSourceResultSchema, { kind: "mutation" }), async () => {
236837
+ await this.wakeIfSleeping();
236838
+ return switchPowerSourceTo(await this.powerSourceTarget(), mode);
236839
+ });
236840
+ }
236002
236841
  this.registerDeviceAction("refresh-sessions", deviceCustomAction(unknown(), _void(), { kind: "mutation" }), async () => {
236003
236842
  await this.refreshSessionsSnapshot();
236004
236843
  });
@@ -236538,6 +237377,65 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
236538
237377
  autoRefreshes: !this.isBattery
236539
237378
  });
236540
237379
  }
237380
+ /** The hub API for a child, the camera's own otherwise, plus the channel to address. */
237381
+ async powerSourceTarget() {
237382
+ return {
237383
+ api: await this.ensureApi(),
237384
+ channel: this.getChannel(),
237385
+ deviceId: this.id,
237386
+ logger: this.ctx.logger
237387
+ };
237388
+ }
237389
+ /**
237390
+ * Battery-cam power-source section (General tab): read the source, switch to
237391
+ * wired or back to battery. Returns `[]` for a wired-only camera. The buttons
237392
+ * dispatch the `read-power-source` / `switch-to-*-power` device actions.
237393
+ */
237394
+ buildPowerSourceSection() {
237395
+ if (!this.isBattery) return [];
237396
+ const switchMessage = "Switch {outcome} · before: {before} · after: {after} · applied: {applied}";
237397
+ return [{
237398
+ id: "power-source",
237399
+ tab: "general",
237400
+ title: "Power source",
237401
+ titleKey: "provider-reolink:schema.s_power-source.title",
237402
+ description: "Only switch to wired power when the adapter meets the camera's spec.",
237403
+ descriptionKey: "provider-reolink:schema.s_power-source.description",
237404
+ columns: 1,
237405
+ fields: [
237406
+ {
237407
+ type: "device-action-button",
237408
+ key: "_readPowerSource",
237409
+ label: "Power source",
237410
+ labelKey: "provider-reolink:schema.s_power-source._readPowerSource.label",
237411
+ buttonLabel: "Read power source",
237412
+ action: "read-power-source",
237413
+ variant: "default",
237414
+ successMessage: "Power source: {source}"
237415
+ },
237416
+ {
237417
+ type: "device-action-button",
237418
+ key: "_switchToWiredPower",
237419
+ label: "Wired power",
237420
+ labelKey: "provider-reolink:schema.s_power-source._switchToWiredPower.label",
237421
+ buttonLabel: "Switch to wired power",
237422
+ action: "switch-to-wired-power",
237423
+ variant: "default",
237424
+ successMessage: switchMessage
237425
+ },
237426
+ {
237427
+ type: "device-action-button",
237428
+ key: "_switchToBatteryPower",
237429
+ label: "Battery power",
237430
+ labelKey: "provider-reolink:schema.s_power-source._switchToBatteryPower.label",
237431
+ buttonLabel: "Switch to battery power",
237432
+ action: "switch-to-battery-power",
237433
+ variant: "default",
237434
+ successMessage: switchMessage
237435
+ }
237436
+ ]
237437
+ }];
237438
+ }
236541
237439
  /**
236542
237440
  * Battery-cam Email Push auto-configure section. Returns `[]` for any
236543
237441
  * camera that wouldn't benefit (wired cams keep a live socket for
@@ -241450,6 +242348,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
241450
242348
  }),
241451
242349
  ...this.buildSessionsTabSections(),
241452
242350
  ...this.buildEmailPushSection(),
242351
+ ...this.buildPowerSourceSection(),
241453
242352
  ...this.buildEmailTabSections(),
241454
242353
  ...buildClipRefreshDeviceSection({
241455
242354
  isHubChild: this.isHubChild(),