The versatile custom Swiss Army Knife card for Home Assistant allows you to create your unique visualization using several graphical tools, styling options and animations.
237
stars
21
forks
source link
Migrate existing widgets per type to separate classes #2
Currently all widgets are maintained in separate lists per type. This takes a lot of code to maintain.
Furthermore, as the widgets are drawn per type, it is not easy to force a certain drawing order to make sure that some objects are layed out on top of other objects.
Using assemblies to group tools makes this possible. For this, the existing widgets must be changed to classes.
The following widgets (tools) should be migrated to classes:
[x] Entity Area
[x] Badge
[x] Sparkbarchart
[x] Circle
[x] Ellipse
[x] Entity Icon
[x] Horse shoe
[x] Line
[x] Entity Name
[x] Entity State
[x] Range Slider
[x] Segmented Arc
[x] User Svg
(Optional): Suggested Solution
Create base class and separate classes per type of tool that can be displayed on the screen.
Each class takes care of its own initialization, configuration, updates and rendering.
The Problem To Be Solved
Currently all widgets are maintained in separate lists per type. This takes a lot of code to maintain. Furthermore, as the widgets are drawn per type, it is not easy to force a certain drawing order to make sure that some objects are layed out on top of other objects.
Using assemblies to group tools makes this possible. For this, the existing widgets must be changed to classes.
The following widgets (tools) should be migrated to classes:
(Optional): Suggested Solution
Create base class and separate classes per type of tool that can be displayed on the screen. Each class takes care of its own initialization, configuration, updates and rendering.
Events must be forwarded to these tool objects.