mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Give fan and remote components unique LED strings (#37605)
This commit is contained in:
parent
550f9ba9b0
commit
368116d242
@ -4,8 +4,8 @@ DOMAIN = "xiaomi_miio"
|
||||
# Fan Services
|
||||
SERVICE_SET_BUZZER_ON = "fan_set_buzzer_on"
|
||||
SERVICE_SET_BUZZER_OFF = "fan_set_buzzer_off"
|
||||
SERVICE_SET_LED_ON = "fan_set_led_on"
|
||||
SERVICE_SET_LED_OFF = "fan_set_led_off"
|
||||
SERVICE_SET_FAN_LED_ON = "fan_set_led_on"
|
||||
SERVICE_SET_FAN_LED_OFF = "fan_set_led_off"
|
||||
SERVICE_SET_CHILD_LOCK_ON = "fan_set_child_lock_on"
|
||||
SERVICE_SET_CHILD_LOCK_OFF = "fan_set_child_lock_off"
|
||||
SERVICE_SET_LED_BRIGHTNESS = "fan_set_led_brightness"
|
||||
@ -34,8 +34,8 @@ SERVICE_EYECARE_MODE_OFF = "light_eyecare_mode_off"
|
||||
|
||||
# Remote Services
|
||||
SERVICE_LEARN = "remote_learn_command"
|
||||
SERVICE_SET_LED_ON = "remote_set_led_on"
|
||||
SERVICE_SET_LED_OFF = "remote_set_led_off"
|
||||
SERVICE_SET_REMOTE_LED_ON = "remote_set_led_on"
|
||||
SERVICE_SET_REMOTE_LED_OFF = "remote_set_led_off"
|
||||
|
||||
# Switch Services
|
||||
SERVICE_SET_WIFI_LED_ON = "switch_set_wifi_led_on"
|
||||
|
@ -53,13 +53,13 @@ from .const import (
|
||||
SERVICE_SET_DRY_OFF,
|
||||
SERVICE_SET_DRY_ON,
|
||||
SERVICE_SET_EXTRA_FEATURES,
|
||||
SERVICE_SET_FAN_LED_OFF,
|
||||
SERVICE_SET_FAN_LED_ON,
|
||||
SERVICE_SET_FAN_LEVEL,
|
||||
SERVICE_SET_FAVORITE_LEVEL,
|
||||
SERVICE_SET_LEARN_MODE_OFF,
|
||||
SERVICE_SET_LEARN_MODE_ON,
|
||||
SERVICE_SET_LED_BRIGHTNESS,
|
||||
SERVICE_SET_LED_OFF,
|
||||
SERVICE_SET_LED_ON,
|
||||
SERVICE_SET_TARGET_HUMIDITY,
|
||||
SERVICE_SET_VOLUME,
|
||||
)
|
||||
@ -463,8 +463,8 @@ SERVICE_SCHEMA_TARGET_HUMIDITY = AIRPURIFIER_SERVICE_SCHEMA.extend(
|
||||
SERVICE_TO_METHOD = {
|
||||
SERVICE_SET_BUZZER_ON: {"method": "async_set_buzzer_on"},
|
||||
SERVICE_SET_BUZZER_OFF: {"method": "async_set_buzzer_off"},
|
||||
SERVICE_SET_LED_ON: {"method": "async_set_led_on"},
|
||||
SERVICE_SET_LED_OFF: {"method": "async_set_led_off"},
|
||||
SERVICE_SET_FAN_LED_ON: {"method": "async_set_led_on"},
|
||||
SERVICE_SET_FAN_LED_OFF: {"method": "async_set_led_off"},
|
||||
SERVICE_SET_CHILD_LOCK_ON: {"method": "async_set_child_lock_on"},
|
||||
SERVICE_SET_CHILD_LOCK_OFF: {"method": "async_set_child_lock_off"},
|
||||
SERVICE_SET_AUTO_DETECT_ON: {"method": "async_set_auto_detect_on"},
|
||||
|
@ -25,7 +25,7 @@ from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers import config_validation as cv, entity_platform
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .const import SERVICE_LEARN, SERVICE_SET_LED_OFF, SERVICE_SET_LED_ON
|
||||
from .const import SERVICE_LEARN, SERVICE_SET_REMOTE_LED_OFF, SERVICE_SET_REMOTE_LED_ON
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@ -158,10 +158,10 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
async_service_learn_handler,
|
||||
)
|
||||
platform.async_register_entity_service(
|
||||
SERVICE_SET_LED_ON, {}, async_service_led_on_handler,
|
||||
SERVICE_SET_REMOTE_LED_ON, {}, async_service_led_on_handler,
|
||||
)
|
||||
platform.async_register_entity_service(
|
||||
SERVICE_SET_LED_OFF, {}, async_service_led_off_handler,
|
||||
SERVICE_SET_REMOTE_LED_OFF, {}, async_service_led_off_handler,
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user