Closed chicaneau closed 1 year ago
This should work:
buttons:
swing_mode:
type: dropdown
icon: mdi:approximately-equal
state:
attribute: swing_mode
mapper: >
(state,entity) => (state === 'VerticalOff' ? 'off': 'on')
source:
VerticalOff: 'Off'
VerticalSwing: 'Vertical Swing'
active: >
state => state !== 'off'
change_action: >
(selected, state, entity) => this.call_service('climate', 'set_swing_mode', { entity_id: entity.entity_id, swing_mode: selected })
Sweet! that works perfectly. Thanks so much @regevbr
Hey,
so i use the lg smartthings custom component for my climate control for an air conditioner. I don't seem to be able to get the swing mode button to go grey when the swing_mode attribute is set to 'VerticalOff' there isn't a whole lot of documentation on mapping and I'm not even sure i need to use that or not.
I tried messing with style too, but I can't work out what state,entity,value refer to either.
Any ideas appreciated, cheers