Update service domain for mysensors from 'switch' to 'mysensor… (#29147)
This commit is contained in:
parent
2d2ab452ca
commit
c80f284ca4
4 changed files with 14 additions and 12 deletions
|
@ -25,6 +25,8 @@ NODE_CALLBACK = "mysensors_node_callback_{}_{}"
|
||||||
TYPE = "type"
|
TYPE = "type"
|
||||||
UPDATE_DELAY = 0.1
|
UPDATE_DELAY = 0.1
|
||||||
|
|
||||||
|
SERVICE_SEND_IR_CODE = "send_ir_code"
|
||||||
|
|
||||||
BINARY_SENSOR_TYPES = {
|
BINARY_SENSOR_TYPES = {
|
||||||
"S_DOOR": {"V_TRIPPED"},
|
"S_DOOR": {"V_TRIPPED"},
|
||||||
"S_MOTION": {"V_TRIPPED"},
|
"S_MOTION": {"V_TRIPPED"},
|
||||||
|
|
|
@ -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'
|
|
@ -6,8 +6,9 @@ from homeassistant.components import mysensors
|
||||||
from homeassistant.components.switch import DOMAIN, SwitchDevice
|
from homeassistant.components.switch import DOMAIN, SwitchDevice
|
||||||
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON
|
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"
|
ATTR_IR_CODE = "V_IR_SEND"
|
||||||
SERVICE_SEND_IR_CODE = "mysensors_send_ir_code"
|
|
||||||
|
|
||||||
SEND_IR_CODE_SERVICE_SCHEMA = vol.Schema(
|
SEND_IR_CODE_SERVICE_SCHEMA = vol.Schema(
|
||||||
{vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, vol.Required(ATTR_IR_CODE): cv.string}
|
{vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, vol.Required(ATTR_IR_CODE): cv.string}
|
||||||
|
@ -64,7 +65,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||||
await device.async_turn_on(**kwargs)
|
await device.async_turn_on(**kwargs)
|
||||||
|
|
||||||
hass.services.async_register(
|
hass.services.async_register(
|
||||||
DOMAIN,
|
MYSENSORS_DOMAIN,
|
||||||
SERVICE_SEND_IR_CODE,
|
SERVICE_SEND_IR_CODE,
|
||||||
async_send_ir_code_service,
|
async_send_ir_code_service,
|
||||||
schema=SEND_IR_CODE_SERVICE_SCHEMA,
|
schema=SEND_IR_CODE_SERVICE_SCHEMA,
|
||||||
|
|
|
@ -21,16 +21,6 @@ toggle:
|
||||||
description: Name(s) of entities to toggle.
|
description: Name(s) of entities to toggle.
|
||||||
example: 'switch.living_room'
|
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:
|
xiaomi_miio_set_wifi_led_on:
|
||||||
description: Turn the wifi led on.
|
description: Turn the wifi led on.
|
||||||
fields:
|
fields:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue