purifier-card 2.3.1 → 2.4.0

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/.eslintrc.json CHANGED
@@ -1,5 +1,10 @@
1
1
  {
2
- "extends": ["eslint:recommended", "prettier"],
2
+ "parser": "@typescript-eslint/parser",
3
+ "extends": [
4
+ "plugin:@typescript-eslint/recommended",
5
+ "eslint:recommended",
6
+ "prettier"
7
+ ],
3
8
  "plugins": ["import"],
4
9
  "env": {
5
10
  "browser": true,
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  [![npm version][npm-image]][npm-url]
6
6
  [![hacs][hacs-image]][hacs-url]
7
+ [![GitHub Sponsors][gh-sponsors-image]][gh-sponsors-url]
7
8
  [![Patreon][patreon-image]][patreon-url]
8
9
  [![Buy Me A Coffee][buymeacoffee-image]][buymeacoffee-url]
9
10
  [![Twitter][twitter-image]][twitter-url]
@@ -16,13 +17,7 @@ By default, the Home Assistant does not provide any card for controlling air pur
16
17
 
17
18
  ## Installing
18
19
 
19
- **💡 Tip:** If you like this project ~~and want to get some stickers and postcards~~, consider becoming a patron:
20
-
21
- <a href="https://patreon.com/denysdovhan">
22
- <img alt="Become a patron" src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="150px">
23
- </a>
24
-
25
- or just buy me a cup of ☕️ or 🥤:
20
+ **💡 Tip:** If you like this project ~~and want to get some stickers and postcards~~, consider giving me a tip for the time I spent building this project:
26
21
 
27
22
  <a href="https://www.buymeacoffee.com/denysdovhan" target="_blank">
28
23
  <img src="https://cdn.buymeacoffee.com/buttons/default-black.png" alt="Buy Me A Coffee" width="150px">
@@ -39,13 +34,16 @@ Just search for `Purifier Card` in the plugins tab.
39
34
  1. Download `purifier-card.js` file from the [latest-release].
40
35
  2. Put `purifier-card.js` file into your `config/www` folder.
41
36
  3. Add a reference to `purifier-card.js` in Lovelace. There's two way to do that:
37
+
42
38
  1. **Using UI:** _Configuration_ → _Lovelace Dashboards_ → _Resources_ → Click Plus button → Set _Url_ as `/local/purifier-card.js` → Set _Resource type_ as `JavaScript Module`.
43
39
  2. **Using YAML:** Add the following code to `lovelace` section.
40
+
44
41
  ```yaml
45
42
  resources:
46
43
  - url: /local/purifier-card.js
47
44
  type: module
48
45
  ```
46
+
49
47
  4. Add `custom:purifier-card` to Lovelace UI as any other card (using either editor or YAML configuration).
50
48
 
51
49
  ## Using the card
@@ -114,9 +112,8 @@ Here is what every option means:
114
112
  | `show_toolbar` | `boolean` | `true` | Show toolbar with shortcuts. |
115
113
  | `compact_view` | `boolean` | `false` | Compact view without image. |
116
114
  | `aqi` | `object` | Optional | Custom entity or attribute for AQI value. |
117
- | `stats` | `object` | Optional | Custom per state stats for your purifier cleaner |
115
+ | `stats` | `array` | Optional | Custom per state stats for your purifier cleaner |
118
116
  | `shortcuts` | `object` | Optional | Custom shortcuts for your purifier cleaner. |
119
- | `platform` | `string` | Optional | Default `xiaomi_miio_airpurifier` |
120
117
 
121
118
  ### `aqi` object
122
119
 
@@ -126,9 +123,11 @@ Here is what every option means:
126
123
  | `attribute` | `string` | Optional | An attribute which should be used to get AQI value. |
127
124
  | `unit` | `string` | Optional | An unit of measurement to display. |
128
125
 
126
+ You can also combine `attribute` with `entity_id` to extract an attribute value of specific entity.
127
+
129
128
  ### `stats` object
130
129
 
131
- You can use any attribute of purifier or even any entity by `entity_id` to display by stats section:
130
+ You can use any attribute of purifier or even any entity by `entity_id` to display by stats section. Not only that, but you can also combine `attribute` with `entity_id` to extract an attribute value of specific entity:
132
131
 
133
132
  | Name | Type | Default | Description |
134
133
  | ---------------- | :------: | -------- | ---------------------------------------------------------------------------------------------------- |
@@ -282,6 +281,8 @@ MIT © [Denys Dovhan][denysdovhan]
282
281
  [npm-image]: https://img.shields.io/npm/v/purifier-card.svg?style=flat-square
283
282
  [hacs-url]: https://github.com/hacs/integration
284
283
  [hacs-image]: https://img.shields.io/badge/hacs-default-orange.svg?style=flat-square
284
+ [gh-sponsors-url]: https://github.com/sponsors/denysdovhan
285
+ [gh-sponsors-image]: https://img.shields.io/github/sponsors/denysdovhan?style=flat-square
285
286
  [patreon-url]: https://patreon.com/denysdovhan
286
287
  [patreon-image]: https://img.shields.io/badge/support-patreon-F96854.svg?style=flat-square
287
288
  [buymeacoffee-url]: https://patreon.com/denysdovhan