`;
@@ -77,6 +107,21 @@ class ButtonCard extends LitElement {
throw new Error('You need to define entity');
}
this.config = config;
+ this.config.color = config.color ? config.color : "var(--primary-text-color)";
+ this.config.size = config.size ? config.size : "40%";
+ let card_style = '';
+ if (config.style) {
+ config.style.forEach(cssObject => {
+ const attribute = Object.keys(cssObject)[0]
+ const value = cssObject[attribute]
+ card_style += `${attribute}: ${value};\n`
+ })
+ }
+ this.config.color_type = config.color_type ? config.color_type : "icon";
+ this.config.color_off = config.color_off ? config.color_off : "var(--disabled-text-color)";
+ this.config.default_color = config.default_color ? config.default_color : "var(--primary-text-color)";
+ this.config.card_style = card_style;
+ this.config.name = config.name ? config.name : "";
}
// The height of your card. Home Assistant uses this to automatically
diff --git a/changelog.md b/changelog.md
new file mode 100644
index 0000000..8ca571b
--- /dev/null
+++ b/changelog.md
@@ -0,0 +1,21 @@
+## 0.0.1
+Initial release that supports versioning
+
+### New features :
+
+ - Color on off state
+ - Default color on light (when color set to `auto` and detection fails)
+ - Background color card
+ - Boolean to show/hide state
+ - Automatic font color based on card color (for readability)
+
+### Changed features :
+
+ - Automatic color mode for lights now has to be enabled via `color: auto`
+ - State display has to be enabled explicity via `show_state: true` and is not enabled by default when an icon is not set
+
+### Other
+
+ - Lots of refactoring
+ - Versionning
+
diff --git a/color.gif b/color.gif
new file mode 100644
index 0000000..c779d3f
Binary files /dev/null and b/color.gif differ