Closed kliu99 closed 1 year ago
I don't think this will work. I think the status query will fail since it only looks at the main component.
Can you run this on that device and send me the results?
curl -H "Authorization: Bearer:
Replace those fields with the proper values and send me the results.
It seems working for me in my local demo. The response is attached: https://gist.github.com/kliu99/4fec6261790bfa391d46f2f5be89af03
The issue is that while you are looking through all of the components for the capabilities, the fetching of status only looks at the ‘main’. It just so happens that the capabilities you care about are in the main component (just not the first one).
I made a smaller simpler change that is checked in. Since you can pull that down and test it. I changed it look at the main component (which is where your light capabilities are). Test this out and let me know.
I will look into better support for multi-component devices in a future release. In order to do that, I need to maintain (track) which component a capability is on so that I can make sure to query the right component.
Let me know how your testing goes.
On Nov 1, 2022, at 8:21 PM, Kai Liu @.***> wrote:
It seems working for me in my local demo. The response is attached: https://gist.github.com/kliu99/4fec6261790bfa391d46f2f5be89af03 https://gist.github.com/kliu99/4fec6261790bfa391d46f2f5be89af03 — Reply to this email directly, view it on GitHub https://github.com/iklein99/homebridge-smartthings/pull/71#issuecomment-1299386373, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG55EQSSDNEO4DT3UB5U43WGGXYJANCNFSM6AAAAAARSU5TNE. You are receiving this because you commented.
I doesn't work in my local instance. Getting comm error: https://gist.github.com/kliu99/1ab072e3d922b7ec47b6bee2e8854ef4
The problem is in the lightService.ts
, you are still reading from accessory.context.device.components[0].capabilities
instead of reading from the main
component. I'd suggest you extract a function like I did in the PR that finds the compatible device component and reuse it in lightService.ts
and also in the platform.ts
so that they won't get out-of-sync in the future.
Give it another try.
Works now. Thanks for the fix.
Are you planning to bump the version so I can get the update for my prod instance?
Yes, I will. The fix will be in the next release.
On Nov 5, 2022, at 3:43 PM, Kai Liu @.***> wrote:
Are you planning to bump the version so I can get the update for my prod instance?
— Reply to this email directly, view it on GitHub https://github.com/iklein99/homebridge-smartthings/pull/71#issuecomment-1304620532, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG55EVWRZ35PBFGU74YX4LWG22FLANCNFSM6AAAAAARSU5TNE. You are receiving this because you modified the open/close state.
Fix #70.