Skip to content

Commit

Permalink
feat: improve message generation function
Browse files Browse the repository at this point in the history
  • Loading branch information
fuatakgun committed Jan 9, 2023
1 parent 2c893b3 commit 1c092e7
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 215 deletions.
8 changes: 6 additions & 2 deletions custom_components/eufy_security/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,26 @@ def platforms(self):

@property
def devices(self) -> dict:
"""get devices from API"""
return self._api.devices

@property
def stations(self) -> dict:
"""get stations from API"""
return self._api.stations

async def set_mfa_and_connect(self, mfa_input: str):
"""set mfa and connect"""
await self._api.set_mfa_and_connect(mfa_input)

async def set_captcha_and_connect(self, captcha_id: str, captcha_input: str):
"""set captcha and connect"""
await self._api.set_captcha_and_connect(captcha_id, captcha_input)

async def send_message(self, message: dict) -> None:
async def send_message(self, message: str) -> None:
"""send message to websocket api"""
_LOGGER.debug(f"send_message - {message}")
await self._api.send_message(json.dumps(message))
await self._api.send_message(message)

async def set_log_level(self, log_level: str) -> None:
"""set log level of websocket server"""
Expand Down
Loading

0 comments on commit 1c092e7

Please sign in to comment.