Comments (10)
Same error on my site
An uncaught exception occurred: TypeError: promise.then(...).catch(...).done is not a function
at PowerSwitchAccessory.BaseAccessory.handleReturnPromise (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/base.coffee:75:10)
at PowerSwitchAccessory.handleReturnPromise (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/base.coffee:1:1)
at null.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/switch.coffee:39:12)
at emitThree (events.js:97:13)
at null.emit (events.js:175:7)
at null.Characteristic.getValue (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Characteristic.js:142:10)
at Bridge.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Accessory.js:706:20)
at Array.forEach (native)
at Bridge.Accessory._handleGetCharacteristics (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Accessory.js:670:8)
at emitMany (events.js:108:13)
at HAPServer.emit (events.js:182:7)
at HAPServer._handleCharacteristics (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/HAPServer.js:926:10)
at HAPServer.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
at emitNone (events.js:67:13)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:923:12)
at nextTickCallbackWith2Args (node.js:458:9)
at process._tickCallback (node.js:372:17)
This is most probably a bug in pimatic or in a module, please report it!
from pimatic-hap.
@newschooler Can you tell which type of device is used?
from pimatic-hap.
@atus I suspect the pimatic-gpio plugin, because it was updated recently. Could you try to revert back to the version before, which would be 0.9.0? Especially is suspect pimatic/pimatic-gpio@35b6472
from pimatic-hap.
@newschooler Can you tell which type of device is used?
Sorry, it's the GpioSwitch as well. I will try to revert and report then.
edit: @michbeck100 I just moved back to pimatic-gpio 0.9.0 plugin and the error is gone.
from pimatic-hap.
confirming that downgrading to pimatic/pimatic-gpio 0.9.0 solves the issue
from pimatic-hap.
Version 0.11.2 should fix this issue. I had the same problem with pimatic-sysinfo, so it was easy to find the problem then.
from pimatic-hap.
Why do you use done() in this context? It should not be used with bluebird promises and it is not part of the standard for native promise. If I recap this correctly done() is used as part of Q, but Q promises should be wrapped by the plugin as much as possible, as the are considered harmful
from pimatic-hap.
@mwittig to be honest, I'm not a JS professional, I've just seen other plugins and pimatic itself using done() (see here) Would be great if you have an example how to use it right, and I will change it for the next release
from pimatic-hap.
Well, me neither. See
- "Awaiting a promise" in https://www.promisejs.org
- http://bluebirdjs.com/docs/api/done.html
Needs further investigation which type of promise it is, as native and bluebird promise should have done()
defined. Also it should be investigate which strategy is the best to avoid such issues:
- Wrap-up Promise like you did, or
- Polyfill which might be a generic solution, e.g. https://www.promisejs.org/polyfills/promise-done-7.0.4.js
- Neglect done().
The use in the pimatic code itself is for historical reasons
from pimatic-hap.
Should be solved together with #78
from pimatic-hap.
Related Issues (20)
- uncaught exception related to pimatic-hap HOT 1
- Deleting device in Pimatic doesn't seem to delete it also in Homekit HOT 13
- Change garage doors to windows shades HOT 4
- Q: Does pimatic-hap plugin require node.js 4.3 to run? HOT 2
- Q: Does this work on iOS 9 using Eve? HOT 2
- error [pimatic]: A uncaught exception occured: Error: dns service error: unknown HOT 1
- accessories/milight.coffee line 24 contains incorrect method name HOT 1
- Cannot find module 'hap-nodejs/node_modules/debug' HOT 2
- Feature request: Tradfri integration (color change) HOT 5
- uncaught exception HOT 4
- Does not work 100% on iOS 11 HOT 9
- [Feature request] Please support Netatmo rain and wind gauge HOT 1
- Error when pressing TradfriPlug switch in homekit on iPhone HOT 7
- dockerized pimatic HOT 4
- add raspbee lights to the supported template list HOT 25
- v0.12.0 - plugin does not start HOT 6
- Support for RaspBeeMultiDevice (Aqara door/window sensors) HOT 2
- [pimatic] error: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode HOT 1
- Devices allow only service selection of Lightbulb and Switch HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pimatic-hap.