emilohman / homey-plejd

This App brings support for the Plejd devices.
MIT License
11 stars 7 forks source link

Won't dim from flows #61

Closed Gustafssondavid closed 12 months ago

Gustafssondavid commented 1 year ago

When a flow triggers the dim-01 & dim-02 to dim the units to a certain level it only turns on the device to the last used brightness. It says in the app that it is at the requested level but it isn't. You can change the brightness from the scale for the specific device.

Coderaxx commented 1 year ago

Also experiencing this issue after app update recently

Coderaxx commented 1 year ago

Hi @emilohman & @Gustafssondavid,

I've identified and fixed the issue with dimming from flows in the Homey Plejd app. The problem was in the runWriteLoop function, where the command queue was not handling the commands efficiently, leading to issues with dimming. The fix involves using .pop() to retrieve commands from the queue, and then filtering out any older commands for the same device with the same action. This ensures that only the most recent command for each device is executed, improving the consistency and reliability of dimming through flows.

You can find the details of the fix in pull request #62. Feel free to check it out for more information.

Best regards, Coderax

richardsimko commented 1 year ago

For anyone looking for a temporary workaround, the last good commit was c44680dd796187b968470d90618761edb6113015. You can check that out, then use the homey CLI to install the app.

  1. homey login
  2. npm install --omit=dev (Installing dev dependencies don't work as it references some packages in a private registry)
  3. homey app install

This should revert your app version to v3.3.4 and mark it as a Development app so it won't be updated. I'm not sure how to get off the development version and restore to the production version but that's a problem for future me, at least the dimming works again now.

Edit: You can simply install the app again from the app store to overwrite the development version

emilohman commented 12 months ago

Thank you @Coderaxx! The PR is merged into master and published on app store!