sinricpro / nodejs-sdk

Nodejs library for https://sinric.pro
11 stars 7 forks source link

setColorTemperature does not seem to work #8

Closed SteffenKn closed 3 years ago

SteffenKn commented 3 years ago

I'm currently switching from sinric to sinricpro and apparently setColorTemperature doesn't work in sinricpro.

Here is my code if that helps: https://github.com/SteffenKn/WS2801-alexa/blob/develop/src/alexa-device-handler.ts

kakopappa commented 3 years ago

Link doesn't work. Private repo?

On Sat, 16 Jan 2021 at 7:02 AM Steffen Knaup notifications@github.com wrote:

I'm currently switching from sinric to sinricpro and apparently setColorTemperature doesn't work in sinricpro.

Here is my code if that helps:

https://github.com/SteffenKn/WS2801-alexa/blob/feature/use_sinric-pro/src/alexa-device-handler.ts

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sinricpro/nodejs-sdk/issues/8, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZAZZQU25Q4QVHYTVTLTO3S2DJRJANCNFSM4WEY4OYA .

SteffenKn commented 3 years ago

I changed the link after creating the issue, maybe you clicked the old one.

SteffenKn commented 3 years ago

Correct me if I'm wrong, but shouldn't there be an if statement for setColorTemperature in this code: https://github.com/sinricpro/nodejs-sdk/blob/ea87b3763a738cde5cf56bee7e814f3019692247/lib/cbhandler.js#L61-L189

kakopappa commented 3 years ago

Yes it looks like setColorTemperature is missing here

On Sat, 16 Jan 2021 at 10:07 AM Steffen Knaup notifications@github.com wrote:

Correct me if I'm wrong, but shouldn't there be an if statement for setColorTemperature in this code:

https://github.com/sinricpro/nodejs-sdk/blob/ea87b3763a738cde5cf56bee7e814f3019692247/lib/cbhandler.js#L61-L189

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/sinricpro/nodejs-sdk/issues/8#issuecomment-761301750, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZAZZVVMFFY3SQZ3P5EYE3S2D7HXANCNFSM4WEY4OYA .

kakopappa commented 3 years ago

@SteffenKn I have updated the SDK to support setColorTemperature. Dhanush will push this to npm repo soon.

Example https://github.com/sinricpro/nodejs-sdk/blob/master/examples/light-bulb/light-bulb.js

SteffenKn commented 3 years ago

Sounds good. Thanks for the quick fix.

SteffenKn commented 3 years ago

I just tested the changes and the callback is now triggered, but Alexa always claims that the device is not responding.

This is due to an bug in the ColorTemperature Controller: https://github.com/sinricpro/nodejs-sdk/blob/232d5e71a8b25909c78107d5ef8989d6625db82d/lib/contorllers/color_temperature.js#L16

This line should end with resolve(payload.value); instead of resolve(payload.colorTemperature);

kakopappa commented 3 years ago

Thanks

Fixed. Wil update the npm soon https://github.com/sinricpro/nodejs-sdk/commit/89b7fc237d81ff71ae2a1e98f5ad7d899eeeb40a

SteffenKn commented 3 years ago

Just a friendly reminder in case you forgot: The package is not yet published.