purifier-card 2.1.4 → 2.2.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/.babelrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": ["@babel/preset-env"]
3
+ }
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
package/README.md CHANGED
@@ -73,8 +73,8 @@ stats:
73
73
  - attribute: motor_speed
74
74
  unit: RPM
75
75
  subtitle: Motor Speed
76
- - value_template: >-
77
- {{ (states('sensor.purifier_filter_life') | float(0) / 3600) | round(1) }}
76
+ - entity_id: sensor.purifier_filter_life
77
+ value_template: '{{ (value | float(0) / 3600) | round(1) }}'
78
78
  unit: hours
79
79
  subtitle: Filter Life
80
80
  shortcuts:
@@ -130,13 +130,13 @@ Here is what every option means:
130
130
 
131
131
  You can use any attribute of purifier or even any entity by `entity_id` to display by stats section:
132
132
 
133
- | Name | Type | Default | Description |
134
- | ---------------- | :------: | -------- | ---------------------------------------------------- |
135
- | `entity_id` | `string` | Optional | An entity_id with state, i.e. `sensor.purifier_aqi`. |
136
- | `attribute` | `string` | Optional | Attribute name of the stat, i.e. `filter_left`. |
137
- | `value_template` | `string` | Optional | Jinja2 template returning a value. |
138
- | `unit` | `string` | Optional | Unit of measure, i.e. `hours`. |
139
- | `subtitle` | `string` | Optional | Friendly name of the stat, i.e. `Filter`. |
133
+ | Name | Type | Default | Description |
134
+ | ---------------- | :------: | -------- | ---------------------------------------------------------------------------------------------------- |
135
+ | `entity_id` | `string` | Optional | An entity_id with state, i.e. `sensor.purifier_aqi`. |
136
+ | `attribute` | `string` | Optional | Attribute name of the stat, i.e. `filter_left`. |
137
+ | `value_template` | `string` | Optional | Jinja2 template returning a value. `value` variable represents the `entity_id` or `attribute` state. |
138
+ | `unit` | `string` | Optional | Unit of measure, i.e. `hours`. |
139
+ | `subtitle` | `string` | Optional | Friendly name of the stat, i.e. `Filter`. |
140
140
 
141
141
  ### `shortcuts` object
142
142