AmoebeLabs / swiss-army-knife-card

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.
232 stars 19 forks source link

Code cleanup: let ToolSet firstUpdated and Updated use function checks for calling tools #142

Closed AmoebeLabs closed 2 years ago

AmoebeLabs commented 2 years ago

The Problem To Be Solved

A Toolsets firstUpdated() and updated() functions check for tool types to pass the call to the tools. This is error prone. Saves a lot of code...

Additional background:

Related Issues (if any)

(Optional): Suggested Solution

So check if a tool has declared the function, and call that function!

(Optional): Alternative Solutions