Skip to content

Commit

Permalink
Merge pull request #28 from KiraPC/dev
Browse files Browse the repository at this point in the history
fix #25
  • Loading branch information
KiraPC committed Nov 28, 2023
2 parents ebcf1c0 + 50a0beb commit beb7e97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions custom_components/switchbotremote/client/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
9 changes: 0 additions & 9 deletions custom_components/switchbotremote/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit beb7e97

Please sign in to comment.