Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
],
[
"set_dimmer", "with_transitiontime", {
'dimmer': 200,
'transition_time': 2
}, {
ATTR_LIGHT_DIMMER: 200,
ATTR_TRANSITION_TIME: 2
},
],
[
"set_state", "true", {
'state': True,
}, {
ATTR_DEVICE_STATE: True,
},
],
[
"set_state", "false", {
'state': False,
}, {
ATTR_DEVICE_STATE: False,
},
],
[
"set_hex_color", "valid", {
'color': '4a418a',
}, {
ATTR_LIGHT_COLOR_HEX: '4a418a',
},
def set_state(self, state, *, index=0):
"""Set state of a socket."""
return self.set_values({
ATTR_DEVICE_STATE: int(state)
}, index=index)
def state(self):
"""Boolean representing the light state of the group."""
return self.raw.get(ATTR_DEVICE_STATE) == 1
def state(self):
return self.raw.get(ATTR_DEVICE_STATE) == 1
def state(self):
"""Return state of start action task."""
return self.raw.get(ATTR_DEVICE_STATE)
def set_dimmer(self, dimmer):
"""Set final dimmer value for task."""
command = {
ATTR_START_ACTION: {
ATTR_DEVICE_STATE: self.state,
ROOT_START_ACTION: [{
ATTR_ID: self.raw[ATTR_ID],
ATTR_LIGHT_DIMMER: dimmer,
ATTR_TRANSITION_TIME: self.raw[ATTR_TRANSITION_TIME]
}, self.devices_dict]
}
}
return self.set_values(command)
def set_state(self, state):
"""Set state of a group."""
return self.set_values({
ATTR_DEVICE_STATE: int(state)
})