Closed robertklep closed 1 year ago
@jeroenvollenbrock This most likely happens when the device isn't ready. A better error should be thrown imo.
I can confirm this behavior for other event types and see a significant amount of errors in Sentry logs.
TypeError: Cannot read property 'target_temperature' of null
File "/node_modules/athom-api/index.js", line 1, col 1122810, in t.value
'{snip} ;if(!r)throw new TypeError("unsupported capability");return new this.constructor.CapabilityInstance({device:this,capabilityId:e,capability:r {snip}
File "./src/app/services/device-manager/DeviceManagerService.ts", line 221, col 73, in h.<anonymous>
device.watchedCapabilities.targetTemperature = await device.makeCapabilityInstance<number>(CapabilityType.TargetTemperature, (evt) => {
?, in Generator.next
File "./node_modules/tslib/tslib.es6.js", line 71, col 1, in null.<anonymous>
step((generator = generator.apply(thisArg, _arguments || [])).next());
?, in new Promise
File "./node_modules/tslib/tslib.es6.js", line 67, col 1, in device
return new (P || (P = Promise))(function (resolve, reject) {
File "./src/app/services/device-manager/DeviceManagerService.ts", line 213, col 34, in apply
private async attachWatchers(device: AuditedDevice) {
@WeeJeWel Will the device.update
run, once the device gets ready?
In certain cases, the following code crashes in
device.makeCapabilityListener
:The error: