finity69x2 / fan-percent-button-row

Frontend plugin to control fans in Home Assistant using percent values for speeds
32 stars 19 forks source link

Add "sendStateWithSpeed" option and update documentation #8

Closed boybert closed 3 years ago

boybert commented 3 years ago

Mirrors the functionality of the original fan-control-entity-row by allowing the turn_on service to be called with each speed change, and updates documentation accordingly.

Same changes as https://github.com/finity69x2/fan-mode-button-row/pull/1 #

ghost commented 2 years ago

anyway to check if the fan power is already on then if using sendStateWithSpeed to not send the command again??.. stop all the double beeping

boybert commented 2 years ago

anyway to check if the fan power is already on then if using sendStateWithSpeed to not send the command again??.. stop all the double beeping

Hi I don't have a suitable device to test on, but I've added a sendStateOnlyWhenOff config entry in a forked branch that I think should do what you're looking for... are you able to test these commits @oziee? If it works for you, I'll can do a PR for the author to consider.

Please make sure you grab the sendStateOnlyWhenOff branch, and make sure you include both sendStateWithSpeed and sendStateOnlyWhenOff as true in your Lovelace entry to test.

https://github.com/boybert/fan-percent-button-row/tree/sendStateOnlyWhenOff

ghost commented 2 years ago

@boybert needs a few lines fixed to work all the lines (all 3) (lines 352, 362, 372) if (stateObj.state == 'off' && this._config.sendStateOnlyWhenOff) {

need to be changed to if (this._stateObj.state == 'off' && this._config.sendStateOnlyWhenOff) {

stateObj is nothing but this._stateObj is right

boybert commented 2 years ago

@oziee Thanks! Made those fixes in my repo, want to give it a try now?