* 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.
37 lines
905 B
YAML
37 lines
905 B
YAML
# Describes the format for available switch services
|
|
|
|
turn_on:
|
|
description: Turn a switch on
|
|
|
|
fields:
|
|
entity_id:
|
|
description: Name(s) of entities to turn on
|
|
example: 'switch.living_room'
|
|
|
|
turn_off:
|
|
description: Turn a switch off
|
|
|
|
fields:
|
|
entity_id:
|
|
description: Name(s) of entities to turn off
|
|
example: 'switch.living_room'
|
|
|
|
toggle:
|
|
description: Toggles a switch state
|
|
|
|
fields:
|
|
entity_id:
|
|
description: Name(s) of entities to toggle
|
|
example: 'switch.living_room'
|
|
|
|
mysensors_send_ir_code:
|
|
description: Set an IR code as a state attribute for a MySensors IR device switch and turn the switch on.
|
|
|
|
fields:
|
|
entity_id:
|
|
description: Name(s) of entites that should have the IR code set and be turned on. Platform dependent.
|
|
example: 'switch.living_room_1_1'
|
|
|
|
V_IR_SEND:
|
|
description: IR code to send
|
|
example: '0xC284'
|