simont77 / fakegato-history

Module to emulate Elgato Eve history
MIT License
168 stars 16 forks source link

custom type error #102

Open thncode opened 4 years ago

thncode commented 4 years ago

I do get the following errors when trying to use the custom type

Unhandled rejection TypeError: thisAccessory.services.forEach is not a function at new FakeGatoHistory (/usr/local/lib/node_modules/fakegato-history/fakegato-history.js:317:29) at new FritzOutletAccessory (/usr/local/lib/node_modules/homebridge-fritz/lib/accessories/outlet.js:48:27) at /usr/local/lib/node_modules/homebridge-fritz/lib/platform.js:123:46 at Array.forEach () at /usr/local/lib/node_modules/homebridge-fritz/lib/platform.js:121:26 at tryCatcher (/usr/local/lib/node_modules/homebridge-fritz/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/homebridge-fritz/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/usr/local/lib/node_modules/homebridge-fritz/node_modules/bluebird/js/release/promise.js:604:18) at Promise._fulfillPromises (/usr/local/lib/node_modules/homebridge-fritz/node_modules/bluebird/js/release/promise.js:704:14) at Promise._settlePromises (/usr/local/lib/node_modules/homebridge-fritz/node_modules/bluebird/js/release/promise.js:730:18) at _drainQueueStep (/usr/local/lib/node_modules/homebridge-fritz/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/usr/local/lib/node_modules/homebridge-fritz/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/usr/local/lib/node_modules/homebridge-fritz/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/homebridge-fritz/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (internal/timers.js:456:21)

what can that possibly be?

simont77 commented 4 years ago

@NorthernMan54 any help here?

NorthernMan54 commented 4 years ago

@thncode can you share a link to your github repo ? I think you not passing the correct accessory context

If you want an example please see my homebridge-tasmota plugin

NorthernMan54 commented 4 years ago

And here in the code base

https://github.com/NorthernMan54/homebridge-tasmota/blob/a9dd9444ec4cf2b8cb834866d1100ebfaf64765e/src/TasmotaService.ts#L66

thncode commented 4 years ago

ok - I kind of found it out - still need to test a lot...