Add mysensors IR switch device and service (#2239)
* Add mysensors IR switch device and service * Add MySensorsIRSwitch as child class to MySensorsSwitch. * Add platform specific service mysensors_send_ir_code. Only call device method in service function if device is IR device. * Add service and required attribute to state helper to support scenes. * Move V_IR_SEND type from sensor.mysensors to switch.mysensors platform. * Populate switch.services.yaml with service descriptions. * Fix check of entity_id in service function Since multiple entity_ids can be passed as service data, and the entity_id service attribute is forced to a list by the service validation schema, the check in the service function should iterate over any entity ids.
This commit is contained in:
parent
ebe4c39020
commit
81ca175906
4 changed files with 160 additions and 7 deletions
|
@ -37,7 +37,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
pres.S_POWER: [set_req.V_WATT, set_req.V_KWH],
|
||||
pres.S_DISTANCE: [set_req.V_DISTANCE],
|
||||
pres.S_LIGHT_LEVEL: [set_req.V_LIGHT_LEVEL],
|
||||
pres.S_IR: [set_req.V_IR_SEND, set_req.V_IR_RECEIVE],
|
||||
pres.S_IR: [set_req.V_IR_RECEIVE],
|
||||
pres.S_WATER: [set_req.V_FLOW, set_req.V_VOLUME],
|
||||
pres.S_CUSTOM: [set_req.V_VAR1,
|
||||
set_req.V_VAR2,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue