Skip to content

Commit

Permalink
Merge pull request #29 from artem-sedykh/dev
Browse files Browse the repository at this point in the history
fix #28
  • Loading branch information
artem-sedykh authored Jun 10, 2020
2 parents bb5e079 + c53a4e8 commit ef1b6b6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Inspired by [mini media player](https://github.com/kalkih/mini-media-player).

```yaml
resources:
- url: /local/mini-humidifier-bundle.js?v=2.1.1
- url: /local/mini-humidifier-bundle.js?v=2.1.2
type: module
```
Expand All @@ -38,14 +38,14 @@ Inspired by [mini media player](https://github.com/kalkih/mini-media-player).
2. Grab `mini-humidifier-bundle.js`

```console
$ wget https://github.com/artem-sedykh/mini-humidifier/releases/download/v2.1.1/mini-humidifier-bundle.js
$ wget https://github.com/artem-sedykh/mini-humidifier/releases/download/v2.1.2/mini-humidifier-bundle.js
```

3. Add a reference to `mini-humidifier-bundle.js` inside your `ui-lovelace.yaml`.

```yaml
resources:
- url: /local/mini-humidifier-bundle.js?v=2.1.1
- url: /local/mini-humidifier-bundle.js?v=2.1.2
type: module
```

Expand All @@ -58,7 +58,7 @@ Inspired by [mini media player](https://github.com/kalkih/mini-media-player).

```yaml
resources:
- url: /local/mini-humidifier-bundle.js?v=2.1.1
- url: /local/mini-humidifier-bundle.js?v=2.1.2
type: module
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mini-humidifier",
"version": "v2.1.1",
"version": "v2.1.2",
"description": "humidifier card for Home Assistant Lovelace UI",
"keywords": [
"home-assistant",
Expand Down
5 changes: 5 additions & 0 deletions release_notes/v2.1.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## v2.1.2
[![Downloads](https://img.shields.io/github/downloads/artem-sedykh/mini-humidifier/v2.1.2/total.svg)](https://github.com/artem-sedykh/mini-humidifier/releases/tag/v2.1.2)

### FIXED
- Fixed bug #28 (Multiple card settings duplicated)
4 changes: 2 additions & 2 deletions src/configurations/zhimi_humidifier_cb1.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ICON from '../const';

const ZHIMI_HUMIDIFIER_CB1 = {
const ZHIMI_HUMIDIFIER_CB1 = () => ({
power: {
icon: ICON.POWER,
type: 'button',
Expand Down Expand Up @@ -126,6 +126,6 @@ const ZHIMI_HUMIDIFIER_CB1 = {
},
},
},
};
});

export default ZHIMI_HUMIDIFIER_CB1;
7 changes: 5 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class MiniHumidifier extends LitElement {
this.buttons = {};
this.targetHumidity = {};
this.power = {};
this.config = {};
}

static get properties() {
Expand Down Expand Up @@ -329,11 +330,13 @@ class MiniHumidifier extends LitElement {
if (!config.entity || config.entity.split('.')[0] !== 'fan')
throw new Error('Specify an entity from within the fan domain.');

let modelConfiguration = HUMIDIFIERS.default;
let modelConfiguration;
const { model } = config;

if (model in HUMIDIFIERS)
modelConfiguration = HUMIDIFIERS[model];
modelConfiguration = HUMIDIFIERS[model]();
else
modelConfiguration = HUMIDIFIERS.default();

this.config = {
model: 'zhimi.humidifier.cb1',
Expand Down

0 comments on commit ef1b6b6

Please sign in to comment.