xoseperez / espurna

Home automation firmware for ESP8266-based devices
http://tinkerman.cat
GNU General Public License v3.0
2.98k stars 636 forks source link

HSV, Brightness, Effect and FastLed #320

Open xoseperez opened 6 years ago

xoseperez commented 6 years ago

Originally reported by: Soif (Bitbucket: soif, GitHub: soif)


First, thank your for merging, and cleaning my IR/Effect PR (31).

I saw that you've implemented it really cleaner , but that you also removed the effects part, and my efforts to implement internal HSV color management using the Fastled library.

Removing my internal HSV management leaded to : (v1.10.2B)

The current web HSV palette has UI bugs.

Ie : Set color to any color other than red, let's say blue, now set the second (or third) fader to 0, then back to 255--> you reset to Red

This might be due to the :

var value = $(this).wheelColorPicker('getValue', 'css');

vs my

var color = $(this).wheelColorPicker('getColor');

and/or due to the internal RGB/HSV conversion not done perfectly.

--> My implementation did NOT have this problem :-p

Brightess (3rd fader in HSV mode, or bottom slider in RGB mode) is near useless!

Because the curse is brutally logarithmic.

--> My brightness implementation did NOT have this problem, and was gently linear :-p


==> I was using the FastLed library for that exact reason

Her color management of RGB Led strips is absolutely CLEVER and well designed.

IMHO, this is as important as her other feature which is : easily and fastly handling addressable led strip (whatever the Chipset type).

To learn more about her clever color implementation, you should specially read :


1) So Might I suggest to internally (re)-implement Fastled HSV color objects, and just translate to RGB for additional MQTT or API accesses.

-> this would add/restore :

2) Implementing Effects

I don't know if you've removed my effect code part because:

But, I might re-implement it (using Fasted, of course, to get beautiful transitions, and allowing addressable light strip effect in the future) if you agree.

So if you mind, would you please just add some DEFINE / IFDEF comments in the code, to give me a clue on where to implement it cleanly, (so that you wont have to highly clean my code after my PR).

Some needed concepts / DEFINES would certainly include something like:

For size reason, we might also plan to implements some basic effects (ie 5 to 10) in the effects.ino file, while adding additionals /more complex ones as optional plugins to include, depending on DEFINEd options.

Best regards

xoseperez commented 6 years ago

I have started working on it on the "fastled" branch. New LIGHT_PROVIDER_FASTLED. At the moment only basic functionality using existing color objects. It turns on/off and changes color with transitions just like any other light provider. Next steps:

xoseperez commented 6 years ago

Issue #245 was marked as a duplicate of this issue.

xoseperez commented 6 years ago

Will work on this as soon as I release the new version, hopefully, this week. Sure you can help but I still have to make up my mind on the requirements.

xoseperez commented 6 years ago

Original comment by Soif (Bitbucket: soif, GitHub: soif):


Great news !

xoseperez commented 6 years ago

Hi

Yes, since your first implementation I had the need to merge both light modules into one and make it more maintainable. Finally I decided to add features to the main light module one by one. I plan to add effects and addressable LED strips too.

cnf commented 5 years ago

Is there any interest in continuing this? I would very much like fastled support.

tarbax commented 5 years ago

fastled support would be awesome! is it still on the list to add support for ?

xoseperez commented 5 years ago

Still on the list.

samtap commented 5 years ago

The fastled branch seems to be quite old and behind master. I'm interested in testing and maybe contribute? I've SK6812 RGBW leds on order, i wonder what the performance would be on an esp8266 with buttons and web server / rest enabled.

mcspr commented 5 years ago

There is another library implementing digital led support: https://github.com/Makuna/NeoPixelBus

My understanding, the main feature is DMA support, which results in much better performance. Even when using WiFi.