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 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 `actions` and `stats` in visual config yet._
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: RPS
72
+ unit: RPM
73
73
  subtitle: Motor Speed
74
- actions:
74
+ shortcuts:
75
75
  - name: Silent
76
76
  icon: 'mdi:weather-night'
77
- speed: Silent
77
+ preset_mode: Silent
78
78
  - name: 25%
79
79
  icon: 'mdi:circle-slice-2'
80
- speed: Favorite
81
- xiaomi_miio_favorite_level: 3
80
+ percentage: 25
82
81
  - name: 50%
83
82
  icon: 'mdi:circle-slice-4'
84
- speed: Favorite
85
- xiaomi_miio_favorite_level: 7
83
+ percentage: 50
86
84
  - name: 75%
87
85
  icon: 'mdi:circle-slice-6'
88
- speed: Favorite
89
- xiaomi_miio_favorite_level: 10
86
+ percentage: 50
90
87
  - name: 100%
91
88
  icon: 'mdi:circle-slice-8'
92
- speed: Favorite
93
- xiaomi_miio_favorite_level: 14
89
+ percentage: 100
94
90
  - name: Auto
95
91
  icon: 'mdi:brightness-auto'
96
- speed: Auto
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
- | `show_speed` | `boolean` | `false` | Show speed of the purifier in the header. |
112
- | `show_preset_mode` | `boolean` | `true` | Show preset mode of the purifier in the header. |
113
- | `show_toolbar` | `boolean` | `true` | Show toolbar with actions. |
114
- | `compact_view` | `boolean` | `false` | Compact view without image. |
115
- | `aqi` | `object` | Optional | Custom entity or attribute for AQI value. |
116
- | `stats` | `object` | Optional | Custom per state stats for your purifier cleaner |
117
- | `actions` | `object` | Optional | Custom actions for your purifier cleaner. |
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
- ### `actions` object
134
+ ### `shortcuts` object
140
135
 
141
- You can define [custom scripts][ha-scripts] for custom actions or add shortcuts for switching modes and speeds via `actions` option.
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 | Type | Default | Description |
144
- | ---------------------------- | :------: | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
145
- | `name` | `string` | Optional | Friendly name of the action, i.e. `Switch to Auto`. |
146
- | `icon` | `string` | Optional | Any icon for action button. |
147
- | `service` | `string` | Optional | A service to call, i.e. `script.clean_air`. |
148
- | `service_data` | `object` | Optional | `service_data` for `service` call |
149
- | `speed` | `object` | Optional | A `speed` to switch to, i.e. `Auto`, etc |
150
- | `xiaomi_miio_favorite_level` | `object` | Optional | A [favorite level][xiaomi-miio-favorite-levels] of the operation mode `Favorite` for Xioami Air Purifiers. `speed` is required with this option |
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 actions is currently active. The action will be highlighted when:
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 `speed` attribute is equal to `action`'s `speed`.
156
- 3. `entity`'s `speed` attribute and `favorite_level` is equal to `action`'s `speed` and `xiaomi_miio_favorite_level` correspondingly.
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://user-images.githubusercontent.com/3459374/94728037-48ee7000-0368-11eb-8637-c8bbc5ffaf99.gif" width="500px">
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/94727372-4ccdc280-0367-11eb-8294-1e5c06a1fe93.png
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