timschuerewegen / homebridge-nikobus

Nikobus platform plugin for Homebridge (https://github.com/nfarina/homebridge)
5 stars 6 forks source link

TypeError: Cannot assign to read only property 'drain' of object '#<Object>' #1

Closed pagaille closed 4 years ago

pagaille commented 4 years ago

Hi, Command output :

# homebridge
[10/3/2019, 6:00:55 PM] Loaded config.json with 0 accessories and 1 platforms.
[10/3/2019, 6:00:55 PM] ---
[10/3/2019, 6:00:56 PM] Loaded plugin: homebridge-nikobus
[10/3/2019, 6:00:56 PM] Registering platform 'homebridge-nikobus.Nikobus'
[10/3/2019, 6:00:56 PM] ---
[10/3/2019, 6:00:56 PM] Loading 1 platforms...
[10/3/2019, 6:00:56 PM] [Nikobus] Initializing Nikobus platform...
[10/3/2019, 6:00:56 PM] [Nikobus] NikobusPlatform() enter
[10/3/2019, 6:00:56 PM] [Nikobus] config = {"platform":"Nikobus","name":"Nikobus","port":"/dev/ttyUSB0","loglevel":9,"modules":[{"type":"switch","name":"Module de commande compact","address":"1EA5","model":"05-002-02","outputs":[{"number":1,"name":"Hall de Nuit","service":"lightbulb"},{"number":2,"name":"S4-2","service":"lightbulb"},{"number":3,"name":"S4-3","service":"lightbulb"},{"number":4,"name":"S4-4","service":"lightbulb"}]},{"type":"switch","name":"Module de commande","address":"4639","model":"05-000-02","outputs":[{"number":1,"name":"FREE","service":"lightbulb"},{"number":2,"name":"Coin Hall","service":"lightbulb"},{"number":3,"name":"Salle à manger","service":"lightbulb"},{"number":4,"name":"FREE2","service":"lightbulb"},{"number":5,"name":"Chaufferie","service":"lightbulb"},{"number":6,"name":"Loupiottes","service":"switch"},{"number":7,"name":"Prises Salon","service":"lightbulb"},{"number":8,"name":"Grenier","service":"lightbulb"},{"number":9,"name":"Terrasse","service":"lightbulb"},{"number":10,"name":"FREE3","service":"lightbulb"},{"number":11,"name":"Escalier","service":"lightbulb"},{"number":12,"name":"Hall","service":"lightbulb"}]}]}
[10/3/2019, 6:00:56 PM] [Nikobus] NikobusPlatform() leave
[10/3/2019, 6:00:56 PM] [Nikobus] NikobusPlatform.accessories() enter
[10/3/2019, 6:00:56 PM] [Nikobus] Nikobus() enter
[10/3/2019, 6:00:56 PM] [Nikobus] path = /dev/ttyUSB0
[10/3/2019, 6:00:56 PM] TypeError: Cannot assign to read only property 'drain' of object '#<Object>'
    at new TaskQueue (/usr/lib/node_modules/homebridge-nikobus/lib/nikobus/TaskQueue.js:21:19)
    at new Nikobus (/usr/lib/node_modules/homebridge-nikobus/lib/nikobus/Nikobus.js:26:15)
    at NikobusPlatform.accessories (/usr/lib/node_modules/homebridge-nikobus/lib/NikobusPlatform.js:36:17)
    at Server._loadPlatformAccessories (/usr/lib/node_modules/homebridge/lib/server.js:403:20)
    at Server._loadPlatforms (/usr/lib/node_modules/homebridge/lib/server.js:341:16)
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:90:36)
    at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:59:10)
    at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
[10/3/2019, 6:00:56 PM] Got SIGTERM, shutting down Homebridge...

Program versions :

npm -v ; node -v
3.10.10
v6.17.1

]# npm ls
/root
└── v8@0.1.0

Any idea ?

timschuerewegen commented 4 years ago

You need to use an older version of the "async" library. I changed the package.json file. Can you try again?

pagaille commented 4 years ago

Sure, thanks !

Not sure what I should do. Update simply using npm update or / and... ?

pagaille commented 4 years ago

Working using npm install -g async@2.6.3 --unsafe-perm

Thanks !

timschuerewegen commented 4 years ago

I forgot to "npm publish" the new version. You can now install/update the plugin via npm and a compatible version of the "async" library will be downloaded/used.