(config: Config)
| 198 | } |
| 199 | |
| 200 | onConfig(config: Config): void { |
| 201 | this.rescheduleTick(); |
| 202 | const t = config.tracker; |
| 203 | const d = this.driver(); |
| 204 | // Rebuild the driver when anything it was CONSTRUCTED with changes — |
| 205 | // limits/units/address are baked in at construction, so a config patch |
| 206 | // (e.g. raising tiltMinDeg as a privacy floor) silently never reached |
| 207 | // the live driver. Key is null until the first config lands, which also |
| 208 | // covers the boot case where the initial driver was built from defaults. |
| 209 | const optsKey = JSON.stringify({ |
| 210 | ip: t.cameraIp, |
| 211 | port: t.viscaPort, |
| 212 | units: t.units, |
| 213 | limits: t.limits, |
| 214 | }); |
| 215 | if (d.kind !== t.driver || this.driverOptsKey !== optsKey) { |
| 216 | this.swapDriver(t.driver); |
| 217 | } |
| 218 | this.driverOptsKey = optsKey; |
| 219 | // Re-evaluate the idle park: a changed home az/el should move the camera |
| 220 | // now, not after the next pass. |
| 221 | this.atHome = false; |
| 222 | } |
| 223 | |
| 224 | setMode(mode: TrackerMode): void { |
| 225 | if (mode === this.mode) return; |
no test coverage detected