scrypted-kasa 1.3.6 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,11 +26,23 @@ In Scrypted:
26
26
  - Exposes the camera's spotlight (when present, e.g. KC420WS) as an `OnOff` child light
27
27
  device in the same room as the camera. Driven by the LINKIE2 control protocol on port
28
28
  10443.
29
- - Exposes the camera's siren (when present) as an `OnOff` child switch device, also in
30
- the camera's room. Triggering it turns the siren on; the camera auto-stops after the
29
+ - Exposes the camera's siren (when present) as an `OnOff` child siren device, also in
30
+ the camera's room. HomeKit shows it as a switch inside the camera accessory. Triggering it turns the siren on; the camera auto-stops after the
31
31
  duration configured in the Kasa app (default 30 s).
32
+ - Exposes the camera's own on/off ("camera off" in the Kasa app) as a **Privacy Mode**
33
+ child switch. On turns the camera off, which stops video for every client, not just
34
+ HomeKit, so it suits home/away automations. While the camera is off, stream attempts fail
35
+ with a short "turned off" message instead of an error, and video resumes on its own when
36
+ it's turned back on.
32
37
  - Exposes the camera's **status LED** as the camera's own `OnOff` interface, so HomeKit's
33
38
  per-camera "Link Status Indicator" toggle drives the LED.
39
+ - Exposes **pan/tilt** (when present, e.g. KC410S) as the camera's own `PanTiltZoom`
40
+ interface: step moves in the Scrypted and NVR camera views, plus the viewpoints saved in
41
+ the Kasa app as presets. HomeKit has no pan/tilt support, so this is not visible there.
42
+ - Adds a **Reboot camera** button to the camera's Settings tab
43
+ (`smartlife.cam.ipcamera.system.set_reboot` over LINKIE2). Useful when the video stream
44
+ stops — connection refused on port 19443 while the control port still answers — which
45
+ otherwise needs a power cycle. The camera is back after about 30 s.
34
46
 
35
47
  ## Plugs / Switches / Dimmers / Bulbs (legacy IOT protocol)
36
48
 
@@ -129,18 +141,28 @@ setup below.
129
141
  features. Wire format: HTTPS POST `/data/LINKIE2.json`, body `application/x-www-form-
130
142
  urlencoded` with a single `content=<base64(xor_ab(json))>` field. The XOR-AB autokey
131
143
  cipher is the same one used by Kasa's UDP/9999 discovery protocol.
132
- - On adoption (and whenever credentials change) the plugin probes three LINKIE2 endpoints
144
+ - On adoption (and whenever credentials change) the plugin probes these LINKIE2 endpoints
133
145
  serially:
134
146
  - `smartlife.cam.ipcamera.dayNight.get_force_lamp_state` — if it returns `on`/`off`, a
135
147
  child `OnOff` light device named "<camera> Spotlight" is registered in the camera's
136
148
  room.
137
149
  - `smartlife.cam.ipcamera.siren.get_state` — same pattern; produces a "<camera> Siren"
138
150
  switch child device.
151
+ - `smartlife.cam.ipcamera.switch.get_is_enable` — produces a "<camera> Privacy Mode"
152
+ switch child device, inverted: on means `set_is_enable` `off`. A turned-off camera
153
+ keeps its stream port open but answers HTTP 503.
139
154
  - `smartlife.cam.ipcamera.led.get_status` — drives the camera's own `OnOff` so HomeKit
140
155
  can bind its `CameraOperatingModeIndicator` (a.k.a. "Status Light") characteristic to
141
156
  it. Enable **Link Status Indicator** in the HomeKit plugin's per-camera settings to
142
157
  activate the binding.
143
158
  - Toggling any of the three calls the matching `set_*` method with `{"value": "on"|"off"}`.
159
+ - `smartlife.cam.ipcamera.ptz.get_capability` — if it succeeds, `PanTiltZoom` is added to
160
+ the camera and `get_all_preset` populates its presets. Fixed-lens models answer with
161
+ `-10008` and are left alone. Moves use `set_move` with `{"direction":
162
+ "left"|"right"|"top"|"bottom", "speed": 1-10}`, where speed is the step size of a single
163
+ discrete step (Scrypted's -1..1 magnitude maps to `ceil(|v| * 10)`); presets use
164
+ `set_run_to_preset` with `{"index": n}`. There is no absolute-position, home, or zoom
165
+ command, so those PTZ movements are rejected.
144
166
 
145
167
  ## Notes / limitations
146
168
 
@@ -152,6 +174,11 @@ setup below.
152
174
  header on the very first request — the camera silently drops requests that don't look
153
175
  enough like the official app.
154
176
  - The camera presents a self-signed TLS certificate; certificate verification is disabled.
177
+ - **One stream connection per camera.** The camera serves a single client on the stream
178
+ port (19443); a second connection opens at the TCP level but stalls in the TLS handshake
179
+ until it times out. Scrypted's rebroadcast (prebuffer) plugin holds that one connection
180
+ and fans it out to HomeKit, the NVR and other clients, so keep it enabled. Another local
181
+ client (a second NVR, a manual `curl`) can't connect to the stream while Scrypted holds it.
155
182
  - Auto-discovery sweeps the local /24 only. Larger subnets (e.g. /23) are skipped to
156
183
  avoid flooding.
157
184
 
package/dist/plugin.zip CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scrypted-kasa",
3
- "version": "1.3.6",
3
+ "version": "1.6.0",
4
4
  "description": "TP-Link Kasa plugin for Scrypted — cameras (video, two-way audio, spotlight, siren, status LED), plugs/outlets, wall switches, dimmers, and smart bulbs (on/off, brightness, color, color temperature).",
5
5
  "author": "Sergey Vilgelm <sergey@vilgelm.com>",
6
6
  "license": "MIT",
@@ -78,12 +78,13 @@
78
78
  "typescript-eslint": "^8.59.1"
79
79
  },
80
80
  "overrides": {
81
- "serialize-javascript": "^7.0.5",
82
- "adm-zip": "^0.6.0",
81
+ "serialize-javascript": "^7.1.3",
82
+ "adm-zip": "^0.6.1",
83
83
  "@babel/core": "^7.29.7",
84
84
  "webpack-bundle-analyzer": {
85
85
  "ws": "^7.5.13"
86
- }
86
+ },
87
+ "minimatch": "^11.0.1"
87
88
  },
88
89
  "engines": {
89
90
  "node": ">=20"