From 5836f8edb55a40652fc65bdddbcf4b118053b232 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 15 Aug 2024 10:11:43 +0200 Subject: [PATCH] Pass None instead of empty dict when registering entity services (#123879) * Pass None instead of empty dict when registering entity services * Update rainmachine --- .../components/media_player/__init__.py | 26 +++++++++---------- homeassistant/components/modern_forms/fan.py | 2 +- .../components/modern_forms/light.py | 2 +- homeassistant/components/motioneye/camera.py | 2 +- homeassistant/components/netatmo/climate.py | 2 +- homeassistant/components/prosegur/camera.py | 2 +- .../components/rainmachine/switch.py | 16 ++++++------ homeassistant/components/roborock/vacuum.py | 2 +- homeassistant/components/select/__init__.py | 4 +-- homeassistant/components/siren/__init__.py | 4 +-- .../components/snapcast/media_player.py | 6 ++--- .../components/sonos/media_player.py | 4 ++- .../components/squeezebox/media_player.py | 2 +- homeassistant/components/switch/__init__.py | 6 ++--- homeassistant/components/timer/__init__.py | 6 ++--- homeassistant/components/todo/__init__.py | 2 +- .../totalconnect/alarm_control_panel.py | 4 +-- homeassistant/components/upb/light.py | 2 +- homeassistant/components/upb/scene.py | 4 +-- homeassistant/components/update/__init__.py | 4 +-- homeassistant/components/vacuum/__init__.py | 12 ++++----- homeassistant/components/valve/__init__.py | 11 +++++--- homeassistant/components/verisure/camera.py | 2 +- homeassistant/components/verisure/lock.py | 4 +-- .../components/water_heater/__init__.py | 4 +-- homeassistant/components/wemo/fan.py | 2 +- .../components/xiaomi_miio/remote.py | 4 +-- .../components/xiaomi_miio/vacuum.py | 4 +-- 28 files changed, 75 insertions(+), 70 deletions(-) diff --git a/homeassistant/components/media_player/__init__.py b/homeassistant/components/media_player/__init__.py index d499ee8d6d3..beb672a1e58 100644 --- a/homeassistant/components/media_player/__init__.py +++ b/homeassistant/components/media_player/__init__.py @@ -274,59 +274,59 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: await component.async_setup(config) component.async_register_entity_service( - SERVICE_TURN_ON, {}, "async_turn_on", [MediaPlayerEntityFeature.TURN_ON] + SERVICE_TURN_ON, None, "async_turn_on", [MediaPlayerEntityFeature.TURN_ON] ) component.async_register_entity_service( - SERVICE_TURN_OFF, {}, "async_turn_off", [MediaPlayerEntityFeature.TURN_OFF] + SERVICE_TURN_OFF, None, "async_turn_off", [MediaPlayerEntityFeature.TURN_OFF] ) component.async_register_entity_service( SERVICE_TOGGLE, - {}, + None, "async_toggle", [MediaPlayerEntityFeature.TURN_OFF | MediaPlayerEntityFeature.TURN_ON], ) component.async_register_entity_service( SERVICE_VOLUME_UP, - {}, + None, "async_volume_up", [MediaPlayerEntityFeature.VOLUME_SET, MediaPlayerEntityFeature.VOLUME_STEP], ) component.async_register_entity_service( SERVICE_VOLUME_DOWN, - {}, + None, "async_volume_down", [MediaPlayerEntityFeature.VOLUME_SET, MediaPlayerEntityFeature.VOLUME_STEP], ) component.async_register_entity_service( SERVICE_MEDIA_PLAY_PAUSE, - {}, + None, "async_media_play_pause", [MediaPlayerEntityFeature.PLAY | MediaPlayerEntityFeature.PAUSE], ) component.async_register_entity_service( - SERVICE_MEDIA_PLAY, {}, "async_media_play", [MediaPlayerEntityFeature.PLAY] + SERVICE_MEDIA_PLAY, None, "async_media_play", [MediaPlayerEntityFeature.PLAY] ) component.async_register_entity_service( - SERVICE_MEDIA_PAUSE, {}, "async_media_pause", [MediaPlayerEntityFeature.PAUSE] + SERVICE_MEDIA_PAUSE, None, "async_media_pause", [MediaPlayerEntityFeature.PAUSE] ) component.async_register_entity_service( - SERVICE_MEDIA_STOP, {}, "async_media_stop", [MediaPlayerEntityFeature.STOP] + SERVICE_MEDIA_STOP, None, "async_media_stop", [MediaPlayerEntityFeature.STOP] ) component.async_register_entity_service( SERVICE_MEDIA_NEXT_TRACK, - {}, + None, "async_media_next_track", [MediaPlayerEntityFeature.NEXT_TRACK], ) component.async_register_entity_service( SERVICE_MEDIA_PREVIOUS_TRACK, - {}, + None, "async_media_previous_track", [MediaPlayerEntityFeature.PREVIOUS_TRACK], ) component.async_register_entity_service( SERVICE_CLEAR_PLAYLIST, - {}, + None, "async_clear_playlist", [MediaPlayerEntityFeature.CLEAR_PLAYLIST], ) @@ -423,7 +423,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: [MediaPlayerEntityFeature.SHUFFLE_SET], ) component.async_register_entity_service( - SERVICE_UNJOIN, {}, "async_unjoin_player", [MediaPlayerEntityFeature.GROUPING] + SERVICE_UNJOIN, None, "async_unjoin_player", [MediaPlayerEntityFeature.GROUPING] ) component.async_register_entity_service( diff --git a/homeassistant/components/modern_forms/fan.py b/homeassistant/components/modern_forms/fan.py index c00549c327a..e34038c7be7 100644 --- a/homeassistant/components/modern_forms/fan.py +++ b/homeassistant/components/modern_forms/fan.py @@ -56,7 +56,7 @@ async def async_setup_entry( platform.async_register_entity_service( SERVICE_CLEAR_FAN_SLEEP_TIMER, - {}, + None, "async_clear_fan_sleep_timer", ) diff --git a/homeassistant/components/modern_forms/light.py b/homeassistant/components/modern_forms/light.py index e758a50e77e..4c210038694 100644 --- a/homeassistant/components/modern_forms/light.py +++ b/homeassistant/components/modern_forms/light.py @@ -61,7 +61,7 @@ async def async_setup_entry( platform.async_register_entity_service( SERVICE_CLEAR_LIGHT_SLEEP_TIMER, - {}, + None, "async_clear_light_sleep_timer", ) diff --git a/homeassistant/components/motioneye/camera.py b/homeassistant/components/motioneye/camera.py index da5eb36d494..d84f7b43c04 100644 --- a/homeassistant/components/motioneye/camera.py +++ b/homeassistant/components/motioneye/camera.py @@ -136,7 +136,7 @@ async def async_setup_entry( ) platform.async_register_entity_service( SERVICE_SNAPSHOT, - {}, + None, "async_request_snapshot", ) diff --git a/homeassistant/components/netatmo/climate.py b/homeassistant/components/netatmo/climate.py index e257c7a89ea..c2953b9d49d 100644 --- a/homeassistant/components/netatmo/climate.py +++ b/homeassistant/components/netatmo/climate.py @@ -174,7 +174,7 @@ async def async_setup_entry( ) platform.async_register_entity_service( SERVICE_CLEAR_TEMPERATURE_SETTING, - {}, + None, "_async_service_clear_temperature_setting", ) diff --git a/homeassistant/components/prosegur/camera.py b/homeassistant/components/prosegur/camera.py index fd911fa5898..2df6ff62038 100644 --- a/homeassistant/components/prosegur/camera.py +++ b/homeassistant/components/prosegur/camera.py @@ -31,7 +31,7 @@ async def async_setup_entry( platform = async_get_current_platform() platform.async_register_entity_service( SERVICE_REQUEST_IMAGE, - {}, + None, "async_request_image", ) diff --git a/homeassistant/components/rainmachine/switch.py b/homeassistant/components/rainmachine/switch.py index d4c0064219e..8368db47d61 100644 --- a/homeassistant/components/rainmachine/switch.py +++ b/homeassistant/components/rainmachine/switch.py @@ -6,7 +6,7 @@ import asyncio from collections.abc import Awaitable, Callable, Coroutine from dataclasses import dataclass from datetime import datetime -from typing import Any, Concatenate, cast +from typing import Any, Concatenate from regenmaschine.errors import RainMachineError import voluptuous as vol @@ -184,8 +184,8 @@ async def async_setup_entry( """Set up RainMachine switches based on a config entry.""" platform = entity_platform.async_get_current_platform() - for service_name, schema, method in ( - ("start_program", {}, "async_start_program"), + services: tuple[tuple[str, VolDictType | None, str], ...] = ( + ("start_program", None, "async_start_program"), ( "start_zone", { @@ -195,11 +195,11 @@ async def async_setup_entry( }, "async_start_zone", ), - ("stop_program", {}, "async_stop_program"), - ("stop_zone", {}, "async_stop_zone"), - ): - schema_dict = cast(VolDictType, schema) - platform.async_register_entity_service(service_name, schema_dict, method) + ("stop_program", None, "async_stop_program"), + ("stop_zone", None, "async_stop_zone"), + ) + for service_name, schema, method in services: + platform.async_register_entity_service(service_name, schema, method) data = entry.runtime_data entities: list[RainMachineBaseSwitch] = [] diff --git a/homeassistant/components/roborock/vacuum.py b/homeassistant/components/roborock/vacuum.py index f7fc58161a8..81a10e26415 100644 --- a/homeassistant/components/roborock/vacuum.py +++ b/homeassistant/components/roborock/vacuum.py @@ -69,7 +69,7 @@ async def async_setup_entry( platform.async_register_entity_service( GET_MAPS_SERVICE_NAME, - {}, + None, RoborockVacuum.get_maps.__name__, supports_response=SupportsResponse.ONLY, ) diff --git a/homeassistant/components/select/__init__.py b/homeassistant/components/select/__init__.py index 27d41dafcd1..24f7d8bffea 100644 --- a/homeassistant/components/select/__init__.py +++ b/homeassistant/components/select/__init__.py @@ -66,13 +66,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: component.async_register_entity_service( SERVICE_SELECT_FIRST, - {}, + None, SelectEntity.async_first.__name__, ) component.async_register_entity_service( SERVICE_SELECT_LAST, - {}, + None, SelectEntity.async_last.__name__, ) diff --git a/homeassistant/components/siren/__init__.py b/homeassistant/components/siren/__init__.py index 216e111b7db..801ca4f2bee 100644 --- a/homeassistant/components/siren/__init__.py +++ b/homeassistant/components/siren/__init__.py @@ -129,11 +129,11 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: [SirenEntityFeature.TURN_ON], ) component.async_register_entity_service( - SERVICE_TURN_OFF, {}, "async_turn_off", [SirenEntityFeature.TURN_OFF] + SERVICE_TURN_OFF, None, "async_turn_off", [SirenEntityFeature.TURN_OFF] ) component.async_register_entity_service( SERVICE_TOGGLE, - {}, + None, "async_toggle", [SirenEntityFeature.TURN_ON | SirenEntityFeature.TURN_OFF], ) diff --git a/homeassistant/components/snapcast/media_player.py b/homeassistant/components/snapcast/media_player.py index 0918d6465ad..bda411acde3 100644 --- a/homeassistant/components/snapcast/media_player.py +++ b/homeassistant/components/snapcast/media_player.py @@ -42,12 +42,12 @@ def register_services(): """Register snapcast services.""" platform = entity_platform.async_get_current_platform() - platform.async_register_entity_service(SERVICE_SNAPSHOT, {}, "snapshot") - platform.async_register_entity_service(SERVICE_RESTORE, {}, "async_restore") + platform.async_register_entity_service(SERVICE_SNAPSHOT, None, "snapshot") + platform.async_register_entity_service(SERVICE_RESTORE, None, "async_restore") platform.async_register_entity_service( SERVICE_JOIN, {vol.Required(ATTR_MASTER): cv.entity_id}, handle_async_join ) - platform.async_register_entity_service(SERVICE_UNJOIN, {}, handle_async_unjoin) + platform.async_register_entity_service(SERVICE_UNJOIN, None, handle_async_unjoin) platform.async_register_entity_service( SERVICE_SET_LATENCY, {vol.Required(ATTR_LATENCY): cv.positive_int}, diff --git a/homeassistant/components/sonos/media_player.py b/homeassistant/components/sonos/media_player.py index 4125466bd99..590761752c5 100644 --- a/homeassistant/components/sonos/media_player.py +++ b/homeassistant/components/sonos/media_player.py @@ -162,7 +162,9 @@ async def async_setup_entry( "set_sleep_timer", ) - platform.async_register_entity_service(SERVICE_CLEAR_TIMER, {}, "clear_sleep_timer") + platform.async_register_entity_service( + SERVICE_CLEAR_TIMER, None, "clear_sleep_timer" + ) platform.async_register_entity_service( SERVICE_UPDATE_ALARM, diff --git a/homeassistant/components/squeezebox/media_player.py b/homeassistant/components/squeezebox/media_player.py index 97d55c2f2ef..552b8ed800c 100644 --- a/homeassistant/components/squeezebox/media_player.py +++ b/homeassistant/components/squeezebox/media_player.py @@ -185,7 +185,7 @@ async def async_setup_entry( {vol.Required(ATTR_OTHER_PLAYER): cv.string}, "async_sync", ) - platform.async_register_entity_service(SERVICE_UNSYNC, {}, "async_unsync") + platform.async_register_entity_service(SERVICE_UNSYNC, None, "async_unsync") # Start server discovery task if not already running entry.async_on_unload(async_at_start(hass, start_server_discovery)) diff --git a/homeassistant/components/switch/__init__.py b/homeassistant/components/switch/__init__.py index 55e0a7a767e..43971741e51 100644 --- a/homeassistant/components/switch/__init__.py +++ b/homeassistant/components/switch/__init__.py @@ -79,9 +79,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: ) await component.async_setup(config) - component.async_register_entity_service(SERVICE_TURN_OFF, {}, "async_turn_off") - component.async_register_entity_service(SERVICE_TURN_ON, {}, "async_turn_on") - component.async_register_entity_service(SERVICE_TOGGLE, {}, "async_toggle") + component.async_register_entity_service(SERVICE_TURN_OFF, None, "async_turn_off") + component.async_register_entity_service(SERVICE_TURN_ON, None, "async_turn_on") + component.async_register_entity_service(SERVICE_TOGGLE, None, "async_toggle") return True diff --git a/homeassistant/components/timer/__init__.py b/homeassistant/components/timer/__init__.py index 3f2b4bd7f43..c2057551239 100644 --- a/homeassistant/components/timer/__init__.py +++ b/homeassistant/components/timer/__init__.py @@ -159,9 +159,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: {vol.Optional(ATTR_DURATION, default=DEFAULT_DURATION): cv.time_period}, "async_start", ) - component.async_register_entity_service(SERVICE_PAUSE, {}, "async_pause") - component.async_register_entity_service(SERVICE_CANCEL, {}, "async_cancel") - component.async_register_entity_service(SERVICE_FINISH, {}, "async_finish") + component.async_register_entity_service(SERVICE_PAUSE, None, "async_pause") + component.async_register_entity_service(SERVICE_CANCEL, None, "async_cancel") + component.async_register_entity_service(SERVICE_FINISH, None, "async_finish") component.async_register_entity_service( SERVICE_CHANGE, {vol.Optional(ATTR_DURATION, default=DEFAULT_DURATION): cv.time_period}, diff --git a/homeassistant/components/todo/__init__.py b/homeassistant/components/todo/__init__.py index 5febc9561c4..d35d9d6bbea 100644 --- a/homeassistant/components/todo/__init__.py +++ b/homeassistant/components/todo/__init__.py @@ -183,7 +183,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: ) component.async_register_entity_service( TodoServices.REMOVE_COMPLETED_ITEMS, - {}, + None, _async_remove_completed_items, required_features=[TodoListEntityFeature.DELETE_TODO_ITEM], ) diff --git a/homeassistant/components/totalconnect/alarm_control_panel.py b/homeassistant/components/totalconnect/alarm_control_panel.py index 17a16674dd5..49d97e45e00 100644 --- a/homeassistant/components/totalconnect/alarm_control_panel.py +++ b/homeassistant/components/totalconnect/alarm_control_panel.py @@ -55,13 +55,13 @@ async def async_setup_entry( platform.async_register_entity_service( SERVICE_ALARM_ARM_AWAY_INSTANT, - {}, + None, "async_alarm_arm_away_instant", ) platform.async_register_entity_service( SERVICE_ALARM_ARM_HOME_INSTANT, - {}, + None, "async_alarm_arm_home_instant", ) diff --git a/homeassistant/components/upb/light.py b/homeassistant/components/upb/light.py index eb20fc949dc..881eda3525f 100644 --- a/homeassistant/components/upb/light.py +++ b/homeassistant/components/upb/light.py @@ -42,7 +42,7 @@ async def async_setup_entry( SERVICE_LIGHT_FADE_START, UPB_BRIGHTNESS_RATE_SCHEMA, "async_light_fade_start" ) platform.async_register_entity_service( - SERVICE_LIGHT_FADE_STOP, {}, "async_light_fade_stop" + SERVICE_LIGHT_FADE_STOP, None, "async_light_fade_stop" ) platform.async_register_entity_service( SERVICE_LIGHT_BLINK, UPB_BLINK_RATE_SCHEMA, "async_light_blink" diff --git a/homeassistant/components/upb/scene.py b/homeassistant/components/upb/scene.py index 9cf6788de4f..276b620d5b5 100644 --- a/homeassistant/components/upb/scene.py +++ b/homeassistant/components/upb/scene.py @@ -31,10 +31,10 @@ async def async_setup_entry( platform = entity_platform.async_get_current_platform() platform.async_register_entity_service( - SERVICE_LINK_DEACTIVATE, {}, "async_link_deactivate" + SERVICE_LINK_DEACTIVATE, None, "async_link_deactivate" ) platform.async_register_entity_service( - SERVICE_LINK_FADE_STOP, {}, "async_link_fade_stop" + SERVICE_LINK_FADE_STOP, None, "async_link_fade_stop" ) platform.async_register_entity_service( SERVICE_LINK_GOTO, UPB_BRIGHTNESS_RATE_SCHEMA, "async_link_goto" diff --git a/homeassistant/components/update/__init__.py b/homeassistant/components/update/__init__.py index e7813b354c1..cd52de6550f 100644 --- a/homeassistant/components/update/__init__.py +++ b/homeassistant/components/update/__init__.py @@ -95,12 +95,12 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: component.async_register_entity_service( SERVICE_SKIP, - {}, + None, async_skip, ) component.async_register_entity_service( "clear_skipped", - {}, + None, async_clear_skipped, ) diff --git a/homeassistant/components/vacuum/__init__.py b/homeassistant/components/vacuum/__init__.py index 90018e2d8cc..867e25d4b2a 100644 --- a/homeassistant/components/vacuum/__init__.py +++ b/homeassistant/components/vacuum/__init__.py @@ -116,37 +116,37 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: component.async_register_entity_service( SERVICE_START, - {}, + None, "async_start", [VacuumEntityFeature.START], ) component.async_register_entity_service( SERVICE_PAUSE, - {}, + None, "async_pause", [VacuumEntityFeature.PAUSE], ) component.async_register_entity_service( SERVICE_RETURN_TO_BASE, - {}, + None, "async_return_to_base", [VacuumEntityFeature.RETURN_HOME], ) component.async_register_entity_service( SERVICE_CLEAN_SPOT, - {}, + None, "async_clean_spot", [VacuumEntityFeature.CLEAN_SPOT], ) component.async_register_entity_service( SERVICE_LOCATE, - {}, + None, "async_locate", [VacuumEntityFeature.LOCATE], ) component.async_register_entity_service( SERVICE_STOP, - {}, + None, "async_stop", [VacuumEntityFeature.STOP], ) diff --git a/homeassistant/components/valve/__init__.py b/homeassistant/components/valve/__init__.py index 3814275b703..04ce12e8a8f 100644 --- a/homeassistant/components/valve/__init__.py +++ b/homeassistant/components/valve/__init__.py @@ -71,11 +71,14 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: await component.async_setup(config) component.async_register_entity_service( - SERVICE_OPEN_VALVE, {}, "async_handle_open_valve", [ValveEntityFeature.OPEN] + SERVICE_OPEN_VALVE, None, "async_handle_open_valve", [ValveEntityFeature.OPEN] ) component.async_register_entity_service( - SERVICE_CLOSE_VALVE, {}, "async_handle_close_valve", [ValveEntityFeature.CLOSE] + SERVICE_CLOSE_VALVE, + None, + "async_handle_close_valve", + [ValveEntityFeature.CLOSE], ) component.async_register_entity_service( @@ -90,12 +93,12 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: ) component.async_register_entity_service( - SERVICE_STOP_VALVE, {}, "async_stop_valve", [ValveEntityFeature.STOP] + SERVICE_STOP_VALVE, None, "async_stop_valve", [ValveEntityFeature.STOP] ) component.async_register_entity_service( SERVICE_TOGGLE, - {}, + None, "async_toggle", [ValveEntityFeature.OPEN | ValveEntityFeature.CLOSE], ) diff --git a/homeassistant/components/verisure/camera.py b/homeassistant/components/verisure/camera.py index 72f5ab93c70..50606a49eab 100644 --- a/homeassistant/components/verisure/camera.py +++ b/homeassistant/components/verisure/camera.py @@ -33,7 +33,7 @@ async def async_setup_entry( platform = async_get_current_platform() platform.async_register_entity_service( SERVICE_CAPTURE_SMARTCAM, - {}, + None, VerisureSmartcam.capture_smartcam.__name__, ) diff --git a/homeassistant/components/verisure/lock.py b/homeassistant/components/verisure/lock.py index da2bc2ced2b..5c56fc0df2c 100644 --- a/homeassistant/components/verisure/lock.py +++ b/homeassistant/components/verisure/lock.py @@ -41,12 +41,12 @@ async def async_setup_entry( platform = async_get_current_platform() platform.async_register_entity_service( SERVICE_DISABLE_AUTOLOCK, - {}, + None, VerisureDoorlock.disable_autolock.__name__, ) platform.async_register_entity_service( SERVICE_ENABLE_AUTOLOCK, - {}, + None, VerisureDoorlock.enable_autolock.__name__, ) diff --git a/homeassistant/components/water_heater/__init__.py b/homeassistant/components/water_heater/__init__.py index 731a513fb66..0b54a4c1aa4 100644 --- a/homeassistant/components/water_heater/__init__.py +++ b/homeassistant/components/water_heater/__init__.py @@ -129,10 +129,10 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: await component.async_setup(config) component.async_register_entity_service( - SERVICE_TURN_ON, {}, "async_turn_on", [WaterHeaterEntityFeature.ON_OFF] + SERVICE_TURN_ON, None, "async_turn_on", [WaterHeaterEntityFeature.ON_OFF] ) component.async_register_entity_service( - SERVICE_TURN_OFF, {}, "async_turn_off", [WaterHeaterEntityFeature.ON_OFF] + SERVICE_TURN_OFF, None, "async_turn_off", [WaterHeaterEntityFeature.ON_OFF] ) component.async_register_entity_service( SERVICE_SET_AWAY_MODE, SET_AWAY_MODE_SCHEMA, async_service_away_mode diff --git a/homeassistant/components/wemo/fan.py b/homeassistant/components/wemo/fan.py index b7c9840bcdc..f9d3270aaa0 100644 --- a/homeassistant/components/wemo/fan.py +++ b/homeassistant/components/wemo/fan.py @@ -67,7 +67,7 @@ async def async_setup_entry( # This will call WemoHumidifier.reset_filter_life() platform.async_register_entity_service( - SERVICE_RESET_FILTER_LIFE, {}, WemoHumidifier.reset_filter_life.__name__ + SERVICE_RESET_FILTER_LIFE, None, WemoHumidifier.reset_filter_life.__name__ ) diff --git a/homeassistant/components/xiaomi_miio/remote.py b/homeassistant/components/xiaomi_miio/remote.py index 959bf0a7bee..72707109ad6 100644 --- a/homeassistant/components/xiaomi_miio/remote.py +++ b/homeassistant/components/xiaomi_miio/remote.py @@ -170,12 +170,12 @@ async def async_setup_platform( ) platform.async_register_entity_service( SERVICE_SET_REMOTE_LED_ON, - {}, + None, async_service_led_on_handler, ) platform.async_register_entity_service( SERVICE_SET_REMOTE_LED_OFF, - {}, + None, async_service_led_off_handler, ) diff --git a/homeassistant/components/xiaomi_miio/vacuum.py b/homeassistant/components/xiaomi_miio/vacuum.py index ef6f94c162f..ac833f7646c 100644 --- a/homeassistant/components/xiaomi_miio/vacuum.py +++ b/homeassistant/components/xiaomi_miio/vacuum.py @@ -104,13 +104,13 @@ async def async_setup_entry( platform.async_register_entity_service( SERVICE_START_REMOTE_CONTROL, - {}, + None, MiroboVacuum.async_remote_control_start.__name__, ) platform.async_register_entity_service( SERVICE_STOP_REMOTE_CONTROL, - {}, + None, MiroboVacuum.async_remote_control_stop.__name__, )