Skip to content

Commit

Permalink
Add version printout
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Oct 25, 2021
1 parent 9e833b5 commit db423dd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 308 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "state-switch",
"private": true,
"version": "1.0.0",
"version": "1.9.0",
"description": "state-switch =================",
"scripts": {
"build": "rollup -c",
Expand Down
10 changes: 9 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { deviceID } from "card-tools/src/deviceID";
import { hasTemplate } from "card-tools/src/templates";
import { bind_template, unbind_template } from "./templates";
import { HassObject, LovelaceCard, StateSwitchConfig } from "./types";
import pjson from "../package.json";

class StateSwitch extends LitElement {
@property() _config: StateSwitchConfig;
Expand Down Expand Up @@ -316,4 +317,11 @@ class StateSwitch extends LitElement {
}
}

customElements.define("state-switch", StateSwitch as any);
if (!customElements.get("state-switch")) {
customElements.define("state-switch", StateSwitch);
console.info(
`%cSTATE-SWITCH ${pjson.version} IS INSTALLED`,
"color: green; font-weight: bold",
""
);
}
Loading

0 comments on commit db423dd

Please sign in to comment.