smarthomej / addons

SmartHome/J addons for openHAB
Eclipse Public License 2.0
62 stars 26 forks source link

[tuya] Add dimmer reversed value support #542

Closed jsetton closed 11 months ago

jsetton commented 11 months ago

Some dimmer type channel should have the ability to support inverted values. This is useful for the temp_value channel which is generally implemented, compared to similar light control addons, from colder (0%) to warmer (100%).

J-N-K commented 11 months ago

Wouldn't this also be possible with the INVERT profile?

jsetton commented 11 months ago

As far as I can see (using the latest OH 4.2-SNAPSHOT), I don't see any INVERT profile available. However, I am aware that a MAP or a SCRIPT profile can achieve this. But I think this is added complexity especially since the channel definitions for the Tuya addon are already generic, I figured it wouldn't hurt to have that option at that level.

I could make the case that the addon should actually invert the temp_value data point by default to keep the consistency across the OH ecosystem. If you rather hardcode that use case, I don't have any issue with that.

jsetton commented 11 months ago

I made the changes based on your comments.

J-N-K commented 11 months ago

Looks good. the only thing missing is the documentation. Can you add the parameter to the channel documentation in README.md?

jsetton commented 11 months ago

I updated the documentation.

J-N-K commented 11 months ago

Unfortunately there is now a merge conflict after I merged your other PR. Can you fix that? Thanks.

jsetton commented 11 months ago

Done.