purifier-card 0.13.0 → 2.0.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/README.md +38 -43
- package/dist/purifier-card.js +131 -75
- package/package.json +1 -1
- package/src/purifier-card-editor.js +15 -0
- package/src/purifier-card.js +66 -108
- package/src/styles.js +56 -7
- package/src/translations/bg.json +2 -3
- package/src/translations/ca.json +2 -3
- package/src/translations/de.json +2 -3
- package/src/translations/en.json +5 -3
- package/src/translations/fr.json +2 -3
- package/src/translations/it.json +2 -3
- package/src/translations/nb.json +2 -3
- package/src/translations/pl.json +2 -3
- package/src/translations/ru.json +3 -4
- package/src/translations/tr.json +2 -3
- package/src/translations/uk.json +2 -3
- package/src/translations/zh-CN.json +2 -3
- package/src/translations/zh-TW.json +2 -3
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ This card can be configured using Lovelace UI editor.
|
|
|
57
57
|
5. Choose `entity`.
|
|
58
58
|
6. Now you should see the preview of the card!
|
|
59
59
|
|
|
60
|
-
_Sorry, no support for `
|
|
60
|
+
_Sorry, no support for `shortcuts` and `stats` in visual config yet._
|
|
61
61
|
|
|
62
62
|
Typical example of using this card in YAML config would look like this:
|
|
63
63
|
|
|
@@ -69,31 +69,27 @@ stats:
|
|
|
69
69
|
unit: '%'
|
|
70
70
|
subtitle: Filter Remaining
|
|
71
71
|
- attribute: motor_speed
|
|
72
|
-
unit:
|
|
72
|
+
unit: RPM
|
|
73
73
|
subtitle: Motor Speed
|
|
74
|
-
|
|
74
|
+
shortcuts:
|
|
75
75
|
- name: Silent
|
|
76
76
|
icon: 'mdi:weather-night'
|
|
77
|
-
|
|
77
|
+
preset_mode: Silent
|
|
78
78
|
- name: 25%
|
|
79
79
|
icon: 'mdi:circle-slice-2'
|
|
80
|
-
|
|
81
|
-
xiaomi_miio_favorite_level: 3
|
|
80
|
+
percentage: 25
|
|
82
81
|
- name: 50%
|
|
83
82
|
icon: 'mdi:circle-slice-4'
|
|
84
|
-
|
|
85
|
-
xiaomi_miio_favorite_level: 7
|
|
83
|
+
percentage: 50
|
|
86
84
|
- name: 75%
|
|
87
85
|
icon: 'mdi:circle-slice-6'
|
|
88
|
-
|
|
89
|
-
xiaomi_miio_favorite_level: 10
|
|
86
|
+
percentage: 50
|
|
90
87
|
- name: 100%
|
|
91
88
|
icon: 'mdi:circle-slice-8'
|
|
92
|
-
|
|
93
|
-
xiaomi_miio_favorite_level: 14
|
|
89
|
+
percentage: 100
|
|
94
90
|
- name: Auto
|
|
95
91
|
icon: 'mdi:brightness-auto'
|
|
96
|
-
|
|
92
|
+
preset_mode: Auto
|
|
97
93
|
show_name: true
|
|
98
94
|
show_state: true
|
|
99
95
|
show_toolbar: true
|
|
@@ -102,20 +98,19 @@ compact_view: false
|
|
|
102
98
|
|
|
103
99
|
Here is what every option means:
|
|
104
100
|
|
|
105
|
-
| Name | Type | Default | Description
|
|
106
|
-
| ------------------ | :-------: | ------------ |
|
|
107
|
-
| `type` | `string` | **Required** | `custom:purifier-card`
|
|
108
|
-
| `entity` | `string` | **Required** | An entity_id within the `fan` domain.
|
|
109
|
-
| `show_name` | `boolean` | `true` | Show friendly name of the purifier.
|
|
110
|
-
| `show_status` | `boolean` | `true` | Show status of the purifier.
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `platform` | `string` | Optional | Default 'xiaomi_miio', for [Xiaomi Mi Air Purifier & Xiaomi Mi Air Humidifier Integration](https://github.com/syssi/xiaomi_airpurifier) you must specify `xiaomi_miio_airpurifier` |
|
|
101
|
+
| Name | Type | Default | Description |
|
|
102
|
+
| ------------------ | :-------: | ------------ | ------------------------------------------------ |
|
|
103
|
+
| `type` | `string` | **Required** | `custom:purifier-card` |
|
|
104
|
+
| `entity` | `string` | **Required** | An entity_id within the `fan` domain. |
|
|
105
|
+
| `show_name` | `boolean` | `true` | Show friendly name of the purifier. |
|
|
106
|
+
| `show_status` | `boolean` | `true` | Show status of the purifier. |
|
|
107
|
+
| `show_preset_mode` | `boolean` | `true` | Show preset mode of the purifier in the header. |
|
|
108
|
+
| `show_toolbar` | `boolean` | `true` | Show toolbar with shortcuts. |
|
|
109
|
+
| `compact_view` | `boolean` | `false` | Compact view without image. |
|
|
110
|
+
| `aqi` | `object` | Optional | Custom entity or attribute for AQI value. |
|
|
111
|
+
| `stats` | `object` | Optional | Custom per state stats for your purifier cleaner |
|
|
112
|
+
| `shortcuts` | `object` | Optional | Custom shortcuts for your purifier cleaner. |
|
|
113
|
+
| `platform` | `string` | Optional | Default `xiaomi_miio_airpurifier` |
|
|
119
114
|
|
|
120
115
|
### `aqi` object
|
|
121
116
|
|
|
@@ -136,30 +131,30 @@ You can use any attribute of purifier or even any entity by `entity_id` to displ
|
|
|
136
131
|
| `unit` | `string` | Optional | Unit of measure, i.e. `hours`. |
|
|
137
132
|
| `subtitle` | `string` | Optional | Friendly name of the stat, i.e. `Filter`. |
|
|
138
133
|
|
|
139
|
-
### `
|
|
134
|
+
### `shortcuts` object
|
|
140
135
|
|
|
141
|
-
You can define [custom scripts][ha-scripts] for custom actions or add shortcuts for switching
|
|
136
|
+
You can define [custom scripts][ha-scripts] for custom actions or add shortcuts for switching presets and percentages via `shortcuts` option.
|
|
142
137
|
|
|
143
|
-
| Name
|
|
144
|
-
|
|
|
145
|
-
| `name`
|
|
146
|
-
| `icon`
|
|
147
|
-
| `service`
|
|
148
|
-
| `service_data`
|
|
149
|
-
| `
|
|
150
|
-
| `
|
|
138
|
+
| Name | Type | Default | Description |
|
|
139
|
+
| -------------- | :------: | -------- | ----------------------------------------------------------------------------------------------- |
|
|
140
|
+
| `name` | `string` | Optional | Friendly name of the shortcut, i.e. `Switch to Auto`. |
|
|
141
|
+
| `icon` | `string` | Optional | Any icon for shortcut button. |
|
|
142
|
+
| `service` | `string` | Optional | A service to call, i.e. `script.clean_air`. |
|
|
143
|
+
| `service_data` | `object` | Optional | `service_data` for `service` call |
|
|
144
|
+
| `percentage` | `object` | Optional | A `percentage` to switch to, i.e. `27`, etc. See `entity`'s `percentage_step` for valid values. |
|
|
145
|
+
| `preset_mode` | `object` | Optional | A `speed` to switch to, i.e. `Auto`, etc |
|
|
151
146
|
|
|
152
|
-
The card will automatically try to figure out which one of
|
|
147
|
+
The card will automatically try to figure out which one of shortcuts is currently active. The shortcut will be highlighted when:
|
|
153
148
|
|
|
154
149
|
1. It's a service.
|
|
155
|
-
2. `entity`'s `
|
|
156
|
-
3. `entity`'s `
|
|
150
|
+
2. `entity`'s `percentage` attribute is equal to `shortcut`'s `percentage`.
|
|
151
|
+
3. `entity`'s `preset_mode` attribute is equal to `shortcut`'s `preset_mode`.
|
|
157
152
|
|
|
158
153
|
## Animations
|
|
159
154
|
|
|
160
155
|
I've added an animation for this card to make it alive:
|
|
161
156
|
|
|
162
|
-
<img src="https://
|
|
157
|
+
<img src="https://raw.githubusercontent.com/denysdovhan/purifier-card/master/src/images/purifier-working.gif" width="300px">
|
|
163
158
|
|
|
164
159
|
How did I make this animation? It's a long story…
|
|
165
160
|
|
|
@@ -206,8 +201,8 @@ If this card works with your air purifier, please open a PR and your model to th
|
|
|
206
201
|
- Dyson Pure Humidify+Cool ([using Dyson integration](https://www.home-assistant.io/integrations/dyson/))
|
|
207
202
|
- Winix AM90 Wi-Fi Air Purifier
|
|
208
203
|
- Philips AirPurifier AC3858/50 (partially)
|
|
209
|
-
- [_Your purifier?_][edit-readme]
|
|
210
204
|
- SmartMI Air Purifier
|
|
205
|
+
- [_Your purifier?_][edit-readme]
|
|
211
206
|
|
|
212
207
|
## Development
|
|
213
208
|
|
|
@@ -244,7 +239,7 @@ MIT © [Denys Dovhan][denysdovhan]
|
|
|
244
239
|
|
|
245
240
|
[home-assistant]: https://www.home-assistant.io/
|
|
246
241
|
[hacs]: https://hacs.xyz
|
|
247
|
-
[preview-image]: https://user-images.githubusercontent.com/3459374/
|
|
242
|
+
[preview-image]: https://user-images.githubusercontent.com/3459374/144429511-23d91a48-e296-4d68-a46c-48f3649bdcda.png
|
|
248
243
|
[latest-release]: https://github.com/denysdovhan/purifier-card/releases/latest
|
|
249
244
|
[ha-scripts]: https://www.home-assistant.io/docs/scripts/
|
|
250
245
|
[xiaomi-miio-favorite-levels]: https://www.home-assistant.io/integrations/xiaomi_miio/#service-xiaomi_miiofan_set_favorite_level-air-purifiers-only
|