purifier-card 2.5.0 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "purifier-card",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "Air Purifier card for Home Assistant Lovelace UI",
5
5
  "main": "dist/purifier-card.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@
27
27
  "@types/lodash": "^4.14.195",
28
28
  "custom-card-helpers": "^1.6.4",
29
29
  "ha-template": "^1.2.2",
30
- "home-assistant-js-websocket": "^8.0.1",
30
+ "home-assistant-js-websocket": "^9.1.0",
31
31
  "lit": "^2.2.2",
32
32
  "lodash": "^4.17.21"
33
33
  },
@@ -45,19 +45,19 @@
45
45
  "@typescript-eslint/eslint-plugin": "^5.59.11",
46
46
  "@typescript-eslint/parser": "^5.59.11",
47
47
  "eslint": "^8.14.0",
48
- "eslint-config-prettier": "^8.5.0",
48
+ "eslint-config-prettier": "^9.1.0",
49
49
  "eslint-plugin-import": "^2.20.2",
50
- "husky": "^8.0.1",
50
+ "husky": "^9.0.11",
51
51
  "lint-staged": "^13.0.0",
52
52
  "postcss-preset-env": "^9.1.2",
53
- "prettier": "^2.0.5",
53
+ "prettier": "^3.2.5",
54
54
  "rollup": "^2.7.6",
55
55
  "rollup-plugin-minify-html-literals": "^1.2.6",
56
56
  "rollup-plugin-postcss": "^4.0.2",
57
57
  "rollup-plugin-postcss-lit": "^2.0.0",
58
58
  "rollup-plugin-serve": "^2.0.1",
59
59
  "rollup-plugin-terser": "^7.0.2",
60
- "rollup-plugin-typescript2": "^0.35.0",
60
+ "rollup-plugin-typescript2": "^0.36.0",
61
61
  "semantic-release": "^21.1.1",
62
62
  "typescript": "^5.1.3"
63
63
  },
@@ -73,6 +73,9 @@
73
73
  "singleQuote": true
74
74
  },
75
75
  "release": {
76
+ "branches": [
77
+ "main"
78
+ ],
76
79
  "plugins": [
77
80
  [
78
81
  "@semantic-release/commit-analyzer",
package/src/config.ts CHANGED
@@ -13,6 +13,7 @@ export default function buildConfig(
13
13
  }
14
14
 
15
15
  return {
16
+ ...config, // pass all unlisted properties
16
17
  entity: config.entity,
17
18
  show_name: config.show_name ?? true,
18
19
  show_state: config.show_state ?? true,
@@ -269,10 +269,10 @@ export class PurifierCard extends LitElement {
269
269
  <span class="state-text" alt=${localizedState}>
270
270
  ${localizedState}
271
271
  </span>
272
- <mwc-circular-progress
272
+ <ha-circular-progress
273
273
  .indeterminate=${this.requestInProgress}
274
- density="-5"
275
- ></mwc-circular-progress>
274
+ size="small"
275
+ ></ha-circular-progress>
276
276
  </div>
277
277
  `;
278
278
  }
@@ -293,19 +293,21 @@ export class PurifierCard extends LitElement {
293
293
  } else if (attribute) {
294
294
  state = get(this.entity.attributes, attribute);
295
295
  } else if (entity_id) {
296
- state = this.hass.states[entity_id].state;
296
+ state = this.hass.states[entity_id]?.state;
297
297
  } else {
298
298
  return nothing;
299
299
  }
300
300
 
301
- const value = html`
302
- <ha-template
303
- hass=${this.hass}
304
- template=${value_template}
305
- value=${state}
306
- variables=${{ value: state }}
307
- ></ha-template>
308
- `;
301
+ const value = state
302
+ ? html`
303
+ <ha-template
304
+ hass=${this.hass}
305
+ template=${value_template}
306
+ value=${state}
307
+ variables=${{ value: state }}
308
+ ></ha-template>
309
+ `
310
+ : nothing;
309
311
 
310
312
  return html`
311
313
  <div class="stats-block" @click="${() => this.handleMore(entity_id)}">
@@ -1,37 +1,37 @@
1
1
  {
2
- "common": {
3
- "name": "Tarjeta Purificadora",
4
- "description": "La tarjeta purificadora te permite controlar tu purificador inteligente.",
5
- "not_available": "La entidad no está disponible",
6
- "toggle_power": "Encender/Apagar"
7
- },
8
- "state": {
9
- "on": "Encendido",
10
- "off": "Apagado"
11
- },
12
- "preset_mode": {
13
- "auto": "Automático",
14
- "silent": "Nocturno",
15
- "favorite": "Manual",
16
- "fan": "Ventilador"
17
- },
18
- "error": {
19
- "missing_entity": "¡Se requiere especificar la entidad!"
20
- },
21
- "editor": {
22
- "entity": "Entidad (Requerido)",
23
- "compact_view": "Vista Compacta",
24
- "compact_view_aria_label_on": "Activar vista compacta",
25
- "compact_view_aria_label_off": "Desactivar vista compacta",
26
- "show_name": "Mostrar Nombre",
27
- "show_name_aria_label_on": "Activar mostrar nombre",
28
- "show_name_aria_label_off": "Desactivar mostrar nombre",
29
- "show_state": "Mostrar Estado",
30
- "show_state_aria_label_on": "Activar mostrar estado",
31
- "show_state_aria_label_off": "Desactivar mostrar estado",
32
- "show_toolbar": "Mostrar Barra de Herramientas",
33
- "show_toolbar_aria_label_on": "Activar mostrar barra de herramientas",
34
- "show_toolbar_aria_label_off": "Desactivar mostrar barra de herramientas",
35
- "code_only_note": "Nota: La configuración de acciones y opciones de estadísticas solo está disponible mediante el Editor de Código."
36
- }
37
- }
2
+ "common": {
3
+ "name": "Tarjeta Purificadora",
4
+ "description": "La tarjeta purificadora te permite controlar tu purificador inteligente.",
5
+ "not_available": "La entidad no está disponible",
6
+ "toggle_power": "Encender/Apagar"
7
+ },
8
+ "state": {
9
+ "on": "Encendido",
10
+ "off": "Apagado"
11
+ },
12
+ "preset_mode": {
13
+ "auto": "Automático",
14
+ "silent": "Nocturno",
15
+ "favorite": "Manual",
16
+ "fan": "Ventilador"
17
+ },
18
+ "error": {
19
+ "missing_entity": "¡Se requiere especificar la entidad!"
20
+ },
21
+ "editor": {
22
+ "entity": "Entidad (Requerido)",
23
+ "compact_view": "Vista Compacta",
24
+ "compact_view_aria_label_on": "Activar vista compacta",
25
+ "compact_view_aria_label_off": "Desactivar vista compacta",
26
+ "show_name": "Mostrar Nombre",
27
+ "show_name_aria_label_on": "Activar mostrar nombre",
28
+ "show_name_aria_label_off": "Desactivar mostrar nombre",
29
+ "show_state": "Mostrar Estado",
30
+ "show_state_aria_label_on": "Activar mostrar estado",
31
+ "show_state_aria_label_off": "Desactivar mostrar estado",
32
+ "show_toolbar": "Mostrar Barra de Herramientas",
33
+ "show_toolbar_aria_label_on": "Activar mostrar barra de herramientas",
34
+ "show_toolbar_aria_label_off": "Desactivar mostrar barra de herramientas",
35
+ "code_only_note": "Nota: La configuración de acciones y opciones de estadísticas solo está disponible mediante el Editor de Código."
36
+ }
37
+ }
@@ -1,35 +0,0 @@
1
- name: Release
2
- on:
3
- push:
4
- branches:
5
- - master
6
-
7
- concurrency:
8
- group: ${{ github.workflow }}-${{ github.ref }}
9
- cancel-in-progress: true
10
-
11
- jobs:
12
- release:
13
- name: Prepare release
14
- runs-on: ubuntu-latest
15
- steps:
16
- - name: ⬇️ Checkout Repo
17
- uses: actions/checkout@v3
18
-
19
- - name: ⬢ Setup Node.js
20
- uses: actions/setup-node@v3
21
- with:
22
- node-version: '*'
23
- cache: npm
24
-
25
- - name: 📦 Install Packages
26
- run: npm ci
27
-
28
- - name: 🏗 Build
29
- run: npm run build
30
-
31
- - name: 🚀 Release
32
- run: npx semantic-release
33
- env:
34
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,33 +0,0 @@
1
- name: Validate
2
- on:
3
- push:
4
- pull_request:
5
-
6
- concurrency:
7
- group: ${{ github.workflow }}-${{ github.ref }}
8
- cancel-in-progress: true
9
-
10
- jobs:
11
- validate:
12
- name: Validate
13
- runs-on: ubuntu-latest
14
- steps:
15
- - name: ⬇️ Checkout Repo
16
- uses: actions/checkout@v3
17
-
18
- - name: ⬢ Setup Node.js
19
- uses: actions/setup-node@v3
20
- with:
21
- node-version: '*'
22
- cache: npm
23
-
24
- - name: 📦 Install Packages
25
- run: npm ci
26
-
27
- - name: 🧪 Test
28
- run: npm test
29
-
30
- - name: 👷 HACS validation
31
- uses: hacs/action@main
32
- with:
33
- category: plugin