Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-sedykh committed Jun 14, 2020
1 parent 0048ea0 commit 30d8d26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 9 additions & 0 deletions release_notes/v2.2.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@
entity: fan.xiaomi_miio_device
model: 'deerma.humidifier.mjjsq'
```
default indicators:
- temperature
- humidity
- status (Displays the presence of water in the tank)
default buttons:
- mode
- led
- buzzer
5 changes: 1 addition & 4 deletions src/configurations/deerma_humidifier_mjjsq.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const DEERMA_HUMIDIFIER_MJJSQ = () => ({
high: 'high',
},
active: (state, entity) => (entity.state !== 'off'),
disabled: (state, entity) => (entity.attributes.depth === 0),
state: { attribute: 'mode' },
change_action: (selected, state, entity) => {
const options = { entity_id: entity.entity_id, speed: selected };
Expand All @@ -75,11 +74,9 @@ const DEERMA_HUMIDIFIER_MJJSQ = () => ({
},
led: {
icon: ICON.LEDBUTTON,
type: 'toggle',
type: 'button',
hide: false,
order: 2,
active: state => (state !== 2 && state !== '2'),
source: { true: 'On', false: 'Off' },
state: { attribute: 'led', mapper: state => (state ? 'on' : 'off') },
toggle_action: (state, entity) => {
const service = state === 'on' ? 'xiaomi_miio_set_led_off' : 'xiaomi_miio_set_led_on';
Expand Down

0 comments on commit 30d8d26

Please sign in to comment.