Breina / ha-artnet-led

DMX lighting Integration for Home Assistant. Using the HA Color Mode update and Pyartnet library to control lights in multiple DMX universes over ethernet with the Art-Net protocol.
MIT License
104 stars 9 forks source link

Output Correction not working #61

Open turboPasqual opened 1 week ago

turboPasqual commented 1 week ago

Hi. I noticed that the output correction is not working. Neither for the universe nor for the channels. So I dug deep into the rabbithole and was able to find the 2 underlying problems which can be solved very easily:

1) In light.py you use this code for the output correction:

universe.output_correction = AVAILABLE_CORRECTIONS.get( universe_cfg[CONF_OUTPUT_CORRECTION] ) ... d.channel.output_correction = AVAILABLE_CORRECTIONS.get( device[CONF_OUTPUT_CORRECTION] )

The correct code for this would be: universe.set_output_correction(AVAILABLE_CORRECTIONS.get( universe_cfg[CONF_OUTPUT_CORRECTION] )) ... d.channel.set_output_correction(AVAILABLE_CORRECTIONS.get( device[CONF_OUTPUT_CORRECTION] ))

2) The second problem is probably also quite easy to fix but I am not very good with python. The problem ist the second part of the upper code where you set a correction for the channel. This is alsways set even if did not put it in your homeassistant configuration. So if you put an output correction of e.g quadratic for the universe and don't put any output correction for the channel, it will be set to linear no matter what.