Skip to content

Commit 27e079b

Browse files
committed
[TASK] fix minify code
1 parent a590888 commit 27e079b

File tree

6 files changed

+411
-13
lines changed

6 files changed

+411
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Version - 1.0.1](https://img.shields.io/badge/Version-1.0.1-009688?style=for-the-badge)](https://github.com/KartoffelToby/better-thermostat-ui-card)
1+
[![Version - 1.0.2](https://img.shields.io/badge/Version-1.0.2-009688?style=for-the-badge)](https://github.com/KartoffelToby/better-thermostat-ui-card)
22
[![Discord](https://img.shields.io/discord/925725316540923914.svg?style=for-the-badge)](https://discord.gg/9BUegWTG3K)
33
[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg?style=for-the-badge)](https://github.com/hacs/integration)
44

dist/better-thermostat-ui-card.js

Lines changed: 397 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "better-thermostat-ui-card",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Lovelace better-thermostat-ui",
55
"keywords": [
66
"home-assistant",

rollup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const plugins = [
2929
files: IGNORED_FILES.map((file) => require.resolve(file)),
3030
}),
3131
resolve(),
32-
minifyHTML.default(),
3332
cssImports(),
3433
typescript({
3534
declaration: false,
@@ -40,7 +39,7 @@ const plugins = [
4039
exclude: "node_modules/**",
4140
babelHelpers: "bundled",
4241
}),
43-
...(dev ? [serve(serveOptions)] : [terser({
42+
terser({
4443
compress: {},
4544
warnings: true,
4645
output: {
@@ -53,7 +52,8 @@ const plugins = [
5352
}
5453
},
5554
},
56-
})]),
55+
}),
56+
...(dev ? [serve(serveOptions)] : []),
5757
];
5858

5959
export default [

src/better-thermostat-ui.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export class BetterThermostatUi extends LitElement implements LovelaceCard {
159159
@property({ type: Boolean, reflect: true }) public dragging = false;
160160

161161
private _init: Boolean = true;
162+
private _firstRender: Boolean = true;
162163
private _ignore: Boolean = false;
163164
private _hasWindow: Boolean = false;
164165
private _hasSummer: Boolean = false;
@@ -313,6 +314,8 @@ export class BetterThermostatUi extends LitElement implements LovelaceCard {
313314
314315
#value {
315316
fill: var(--mode-color);
317+
r: 5;
318+
z-index: 9999 !important;
316319
transition: r 0.3s ease-in-out, fill 0.6s ease-in-out;
317320
}
318321
@@ -321,7 +324,7 @@ export class BetterThermostatUi extends LitElement implements LovelaceCard {
321324
}
322325
323326
#value:hover, #value:active, #value:focus, #value.active {
324-
r: 8;
327+
r: 8 !important;
325328
}
326329
327330
#current {
@@ -573,6 +576,7 @@ export class BetterThermostatUi extends LitElement implements LovelaceCard {
573576
end: (this._value2percent(this.current) / 100) || 0
574577
}
575578
});
579+
this._init = false;
576580
}
577581

578582
protected shouldUpdate(changedProps: PropertyValues): boolean {
@@ -596,7 +600,7 @@ export class BetterThermostatUi extends LitElement implements LovelaceCard {
596600
const currentHandler: any = this?.shadowRoot?.querySelector(".current-handler")
597601
if (changedProperties.has("value")) {
598602
gsap.to(valueHandler, {
599-
duration: (changedProperties.get("state") !== undefined ? 5 : 0),
603+
duration: (this._firstRender) ? 0 : 5,
600604
repeat: 0,
601605
repeatDelay: 0,
602606
yoyo: false,
@@ -616,7 +620,7 @@ export class BetterThermostatUi extends LitElement implements LovelaceCard {
616620
}
617621
if (changedProperties.has("current")) {
618622
gsap.to(currentHandler, {
619-
duration: (changedProperties.get("state") !== undefined ? 25 : 0),
623+
duration: (this._firstRender) ? 0 : 25,
620624
repeat: 0,
621625
repeatDelay: 0,
622626
yoyo: false,
@@ -633,6 +637,7 @@ export class BetterThermostatUi extends LitElement implements LovelaceCard {
633637
}
634638
});
635639
}
640+
this._firstRender = false;
636641
}
637642

638643
public willUpdate(changedProps: PropertyValues) {

src/const.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const CARD_VERSION = '1.0.1';
1+
export const CARD_VERSION = '1.0.2';

0 commit comments

Comments
 (0)