Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions homeassistant/components/mysensors/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
TYPE = "type"
UPDATE_DELAY = 0.1

SERVICE_SEND_IR_CODE = "send_ir_code"

BINARY_SENSOR_TYPES = {
"S_DOOR": {"V_TRIPPED"},
"S_MOTION": {"V_TRIPPED"},
Expand Down
9 changes: 9 additions & 0 deletions homeassistant/components/mysensors/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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 entities 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'
5 changes: 3 additions & 2 deletions homeassistant/components/mysensors/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from homeassistant.components.switch import DOMAIN, SwitchDevice
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON

from .const import DOMAIN as MYSENSORS_DOMAIN, SERVICE_SEND_IR_CODE

ATTR_IR_CODE = "V_IR_SEND"
SERVICE_SEND_IR_CODE = "mysensors_send_ir_code"

SEND_IR_CODE_SERVICE_SCHEMA = vol.Schema(
{vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, vol.Required(ATTR_IR_CODE): cv.string}
Expand Down Expand Up @@ -64,7 +65,7 @@ async def async_send_ir_code_service(service):
await device.async_turn_on(**kwargs)

hass.services.async_register(
DOMAIN,
MYSENSORS_DOMAIN,
SERVICE_SEND_IR_CODE,
async_send_ir_code_service,
schema=SEND_IR_CODE_SERVICE_SCHEMA,
Expand Down
10 changes: 0 additions & 10 deletions homeassistant/components/switch/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ toggle:
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 entities 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'

xiaomi_miio_set_wifi_led_on:
description: Turn the wifi led on.
fields:
Expand Down