The intention was to improve the coordinator for this release, but this did not happen. So many changes have collected that its' really time for a new release. What better time to make it than to start off the new year?
This release breaks (again) quite a few APIs, but the DSL should not be impacted by it. That's the one you really should be using. Hence I decided to not put a BC (=Backward Compatibility) breaking warning this time (except if you look at the details below :-)).
Here are the changes for this release
Flexible colors (#71, #78 and others)
This is a major change in how we load the color name modules. Instead of importing them into Fledex.Color.Names module, we now load the specific modules making sure that only those functions are loaded that are not conflicting.
This allows to
use Fledex, colors: [:wiki, :ral, MyOwnColorDefinitions]Fledex.Color.Names is now not generated anymore, but we use the new Fledex.Config to access the configured colors. It generate the Fledex.Config.Data that is internal to it. When use FLedex.Config you have the option to decide on whether you want to import
the configured colors or not.
Note {: .info}
When you
use Fledexthe colors will be imported by default (but you can specifyimports: falseas option), When youuse Fledex.Configthe colors will not be imported by default, but you can specifyimports: trueas option.
Since Fledex.Color.Names does not expose the colors directly anymore, the documentation got broken. Therefore a new mix task mix docs.fledex.colors generates a markdown page with all the colors of all the known color modules and got integrated into the mix docs process so it will be automatically generated for the documentation. This now also includes the Fledex.Color.Names.RAL colors.
All color name modules are now following the same behaviour Fledex.Color.Names.Interface
Warning: {:.warning}
This breaks a couple of things, namely the
Fledex.Color.Namesmodule.
use Fledexseveral times might redefine the colors that are getting imported and should be avoided.
Therefore components should alsoimport Fledexif they want to use the macros, instead ofuse Fledex(This does mean that you would need to be explicit on all the other module names (Leds, color names, ...), but that's rather a good thing.
Related changes
As part of this refactoring a lot of smaller refactorings happened at the same time within the color related modules:
- With the new color handling and the new mix task we don't have a need for the custom
ex_docversion anymore. - Changed the
color_name_tto allow any atom as type and most fields are optional - Removed the most color functions from the color modules. We now only expose
:hex,:name, and:module. The rest of the information is still present but can not be called directly. thus, you can't docolor_name(:rgb)anymore. You can still doinfo(:color_name, :rgb)to retrieve the information. - Adapted the
Fledex.Colorprotocol implementation for atoms. - The
Fledex.Colorprotocol now only exposes a single functionto_colorint/1.to_rgb/1has been removed. - Renamed
Fledex.Color.Names.DsltoFledex.Color.Names.ModuleGeneratorto better reflect it's purpose. - The type
color_struct_thas been extended to allow an arbitrary number of fields and most fields are optional (except the:hexand:namevalues). - The
Fledex.Color.Names.ModuleGeneratorcan now be configured to only create a set of functions (with thefieldsoption) instead of exposing all fields directly. Other color properties can still be retrieved throughcolor_name(what), but it will be an indirection toinfo(:color_name, what). Thus, you could useinfo/1orinfo/2also directly. - Removed the properties from the color name modules that are not "natural" (now that we can do it)
- The
Fledex.Color.Names.ModuleGeneratorhas been cleaned up and got added documentation - updated the documentation and livebooks
- integrating the color guards into the color names module
- Renamed some functions in
Fledex.Color.Names.LoadUtilsto make their purpose more clear - Adding a module for HSV, HSL, RGB.
Fledex.Color.HSVandFledex.Color.HSLare now used instead of a triples. The goal is that triples are reserved for RGBs). For consistency also introduced aFledex.Color.RGB. - Removed
Fledex.Color.to_rgb/1. useFledex.Color.RGB.to_tuple(color)instead - Cleaning up and restructuring the conversion modules
Cleanup and improved API docs (#64, #83 and others)
BIG documentation improvement and cleanups including (also through other commits):
- Added and improved the API documentation (
@specs,@moduledoc, and@docs) - Restructured the API documentation to make the more useful information easier accessible
- Fixed the copyright headers
- Fixed the licenses so we are now FSF compliant. This required to replaced the cone_response picture with a version under a different license.
- Fixed also the License file issue to satisfy the scorecard tool. The overall license is now explicitly mentioned instead of being a link.
- Improved the README.md
- Updated the CREDITS.md file
- Minor improvements to the livebooks for the school (German). This is still WIP
- Added information about color correction to the 3b livebook
- Added API documentation for the conversion functions
- Updated the cheatsheet with coordinator information
- worked on the coordinator livebook (WIP)
- Documented the effect options
- Documented the driver options
- Moved the extra documentation from
docstopages(to make it less confusing with the generated api documentation byex_docthat will end up indoc)
Improved Supervision tree (#84, #110)
The supervision tree has been improved.
- The
AnimationSystemgot some more functions (start_led_strip/4,led_strip_exists?/1,get_led_strips/0,reconfigure_led_strip/3,stop_led_strip/1) and theLedStripSupervisorgot them as well (start_worker/5,worker_exists?/3,get_workers/2,reconfigure_worker/4,stop_worker/3) - Some utility functions got created and moved around to support the above functions
- Replaced Quantum as a job scheduler with a heavily modified version of SchedEx (pulled in as a dependency. The fork can be found as Fledex_Scheduler)
- Reworked the Supervision Tree. The jobs are now properly attached to the LedStrip. Also changed how the process naming is done so it's limited to the supervisors and the manager. Nobody else is aware of process names and the registry.
Other changes
Bugs
- Fixed a documentation bug. The hue value in HSV is a byte representing 360 degrees.
- Fixed a bug in the
Fledex.Supervisor.AnimationSystemthat prevented options to be passed correctly to the Manager. This only became apparent with 2 or more options. - Fixed a bug in
LoadUtils.a2b/1The value wasn't truncated to an integer - Fixed a bug that the
Fledex.Colorprotocol for `Fledex.Color.RGB didn't work in the livebook. Repositioning it solved the issue. Not sure why.
Cleanup
- Renamed some modules to make their purpose more clear
- Changed the
> **Notes**(and similar) to> #### Note {: .info}to be consistent and in accordance with the recommendation in theex_unitdocumentation even though it does "break" things ongithub. - Cleanued up the
Supervisor.Utils(combined functions) - Cleaned up the
Animation.Manager(combined functions) - Changed
LedStrip.reinittochange_config(including the drivers). Changed theLedStrip.change_configtochange_global_configbecause it only changes the global settings and not the drivers. - Renamed the Job pattern to schedule (since it now also allows intervals)
- Aligned the various function names that changed the config to
change_config(instead ofupdate_,change_,config). - Renamed
WikiUtilstoWiki.Converterand removed thefilenamefunction which is not necessary anymore
Depedendencies
- upgrading all dependencies to latest version
- Added
tzdataas an optional dependency
Build
- Adding expert to the .gitignore exclusion list
- updated the max xref, since we have less compile connected files
- Made
credomore strict. enabled all checks that I consider as reasonable and fixed the resulting issues. - Adding support for Elixir 1.19. The latest Elixir version also helped to also reduce the max xref (9 --> 7)
- Made the latest version to run extra tests like formatting, xref, coverage instead of doing it on all versions (since the different versions have different behaviors)
- added
ex_check,doctor,mix_audit,sobelowand configuredex_checkto run all tests. - changed excoveralls to create html and json output so that we can use the same
mix checkand to then upload the coverage result. - Using
ex_checkin the CI pipeline (github action)
Security
- Fixed a directory traversal issue (even though I don't think it could be exploited since it's at c