purifier-card 2.0.0 → 2.0.1

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
@@ -1,3 +1,27 @@
1
+ > # 🇺🇦 UKRAINE NEEDS YOUR HELP NOW!
2
+ >
3
+ > I'm the creator of this project and I'm Ukrainian.
4
+ >
5
+ > **My country, Ukraine, [is being invaded by the Russian Federation, right now](https://www.bbc.com/news/world-europe-60504334)**. I've fled Kyiv and now I'm safe with my family in the western part of Ukraine. At least for now.
6
+ > Russia is hitting target all over my country by ballistic missiles.
7
+ >
8
+ > **Please, save me and help to save my country!**
9
+ >
10
+ > Ukrainian National Bank opened [an account to Raise Funds for Ukraine’s Armed Forces](https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi):
11
+ >
12
+ > ```
13
+ > SWIFT Code NBU: NBUA UA UX
14
+ > JP MORGAN CHASE BANK, New York
15
+ > SWIFT Code: CHASUS33
16
+ > Account: 400807238
17
+ > 383 Madison Avenue, New York, NY 10179, USA
18
+ > IBAN: UA843000010000000047330992708
19
+ > ```
20
+ >
21
+ > You can also donate to [charity supporting Ukrainian army](https://savelife.in.ua/en/donate/).
22
+ >
23
+ > **THANK YOU!**
24
+
1
25
  # Purifier Card
2
26
 
3
27
  [![npm version][npm-image]][npm-url]
@@ -481,7 +481,7 @@ const d="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.pro
481
481
  .toolbar ha-icon {
482
482
  color: var(--primary-color);
483
483
  }
484
- `;console.info("%c PURIFIER-CARD %c 1.0.1 ","color: white; background: blue; font-weight: 700;","color: blue; background: white; font-weight: 700;"),customElements.get("ha-icon-button")||customElements.define("ha-icon-button",class extends(customElements.get("paper-icon-button")){});customElements.define("purifier-card",class extends _{static get properties(){return{hass:Object,config:Object,requestInProgress:Boolean}}static get styles(){return vC}static async getConfigElement(){return document.createElement("purifier-card-editor")}static getStubConfig(A,C){const[I]=C.filter((A=>"fan"===A.substr(0,A.indexOf("."))));return{entity:I||""}}get platform(){return void 0===this.config.platform?"xiaomi_miio_airpurifier":this.config.platform}get entity(){return this.hass.states[this.config.entity]}get showPresetMode(){return void 0===this.config.show_preset_mode||this.config.show_preset_mode}get showName(){return void 0===this.config.show_name||this.config.show_name}get showState(){return void 0===this.config.show_state||this.config.show_state}get showToolbar(){return void 0===this.config.show_toolbar||this.config.show_toolbar}get compactView(){return void 0!==this.config.compact_view&&this.config.compact_view}setConfig(A){if(!A.entity)throw new Error(bC("error.missing_entity"));const C=A.actions;C&&Array.isArray(C)&&console.warn(bC("warning.actions_array")),this.config=A}getCardSize(){return 2}shouldUpdate(A){return function(A,C,I){if(C.has("config")||I)return!0;if(A.config.entity){var E=C.get("hass");return!E||E.states[A.config.entity]!==A.hass.states[A.config.entity]}return!1}(this,A)}updated(A){A.get("hass")&&A.get("hass").states[this.config.entity]!==this.hass.states[this.config.entity]&&(this.requestInProgress=!1)}handleMore(){SA(this,"hass-more-info",{entityId:this.entity.entity_id},{bubbles:!0,composed:!0})}handlePresetMode(A){const C=A.target.getAttribute("value");this.callService("fan.set_preset_mode",{preset_mode:C})}handlePercentage(A){const C=A.detail.value;this.callService("fan.set_percentage",{percentage:C})}callService(A,C={},I=!0){const[E,g]=A.split(".");this.hass.callService(E,g,{entity_id:this.config.entity,...C}),I&&(this.requestInProgress=!0,this.requestUpdate())}renderPresetMode(){const{attributes:{preset_mode:A,preset_modes:C,supported_features:I}}=this.entity;if(!(this.showPresetMode&&C&&8&I))return t``;const E=C.indexOf(A);return t`
484
+ `;console.info("%c PURIFIER-CARD %c 2.0.0 ","color: white; background: blue; font-weight: 700;","color: blue; background: white; font-weight: 700;"),customElements.get("ha-icon-button")||customElements.define("ha-icon-button",class extends(customElements.get("paper-icon-button")){});customElements.define("purifier-card",class extends _{static get properties(){return{hass:Object,config:Object,requestInProgress:Boolean}}static get styles(){return vC}static async getConfigElement(){return document.createElement("purifier-card-editor")}static getStubConfig(A,C){const[I]=C.filter((A=>"fan"===A.substr(0,A.indexOf("."))));return{entity:I||""}}get platform(){return void 0===this.config.platform?"xiaomi_miio_airpurifier":this.config.platform}get entity(){return this.hass.states[this.config.entity]}get showPresetMode(){return void 0===this.config.show_preset_mode||this.config.show_preset_mode}get showName(){return void 0===this.config.show_name||this.config.show_name}get showState(){return void 0===this.config.show_state||this.config.show_state}get showToolbar(){return void 0===this.config.show_toolbar||this.config.show_toolbar}get compactView(){return void 0!==this.config.compact_view&&this.config.compact_view}setConfig(A){if(!A.entity)throw new Error(bC("error.missing_entity"));const C=A.actions;C&&Array.isArray(C)&&console.warn(bC("warning.actions_array")),this.config=A}getCardSize(){return 2}shouldUpdate(A){return function(A,C,I){if(C.has("config")||I)return!0;if(A.config.entity){var E=C.get("hass");return!E||E.states[A.config.entity]!==A.hass.states[A.config.entity]}return!1}(this,A)}updated(A){A.get("hass")&&A.get("hass").states[this.config.entity]!==this.hass.states[this.config.entity]&&(this.requestInProgress=!1)}handleMore(){SA(this,"hass-more-info",{entityId:this.entity.entity_id},{bubbles:!0,composed:!0})}handlePresetMode(A){const C=A.target.getAttribute("value");this.callService("fan.set_preset_mode",{preset_mode:C})}handlePercentage(A){const C=A.detail.value;this.callService("fan.set_percentage",{percentage:C})}callService(A,C={},I=!0){const[E,g]=A.split(".");this.hass.callService(E,g,{entity_id:this.config.entity,...C}),I&&(this.requestInProgress=!0,this.requestUpdate())}renderPresetMode(){const{attributes:{preset_mode:A,preset_modes:C,supported_features:I}}=this.entity;if(!(this.showPresetMode&&C&&8&I))return t``;const E=C.indexOf(A);return t`
485
485
  <div class="preset-mode">
486
486
  <paper-menu-button
487
487
  slot="dropdown-trigger"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "purifier-card",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Air Purifier card for Home Assistant Lovelace UI",
5
5
  "main": "dist/purifier-card.js",
6
6
  "scripts": {