diff --git a/custom_components/switchbotremote/client/remote.py b/custom_components/switchbotremote/client/remote.py index cd7a993..5b3cede 100644 --- a/custom_components/switchbotremote/client/remote.py +++ b/custom_components/switchbotremote/client/remote.py @@ -36,7 +36,7 @@ def command( self, action: str, parameter: Optional[str] = None, - customize: Optional[bool] = False, + customize: Optional[bool] = False ): parameter = "default" if parameter is None else parameter command_type = "customize" if customize else "command" @@ -66,5 +66,5 @@ def turn(self, state: str): class OtherRemote(Remote): remote_type_for = "Others" - def command(self, action: str, parameter: Optional[str] = None): - super().command(action, parameter, True) + def command(self, action: str, parameter: Optional[str] = None, customize: Optional[bool] = False): + super().command(action, parameter, customize) diff --git a/custom_components/switchbotremote/media_player.py b/custom_components/switchbotremote/media_player.py index 7dfdd39..0422981 100644 --- a/custom_components/switchbotremote/media_player.py +++ b/custom_components/switchbotremote/media_player.py @@ -70,15 +70,6 @@ def __init__(self, hass: HomeAssistant, sb: SupportedRemote, options: dict = {}) async def send_command(self, *args): await self._hass.async_add_executor_job(self.sb.command, *args) - async def async_added_to_hass(self): - """Run when entity about to be added.""" - await super().async_added_to_hass() - - last_state = await self.async_get_last_state() - - if last_state is not None: - self._state = last_state.state - @property def device_info(self): return DeviceInfo(