Skip to content

Commit

Permalink
fix: Fix for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Mulliken committed Jun 29, 2021
1 parent df55311 commit aab7a39
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions src/wyzeapy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ async def create(cls):
:return: An instance of the Wyzeapy class
"""
self = Wyzeapy()
self._client = Client("", "")
await self._client.async_init()
return self
cls._client = Client("", "")
await cls._client.async_init()
return cls

async def async_close(self):
await self._client.async_close()
Expand Down
1 change: 0 additions & 1 deletion src/wyzeapy/services/base_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# the license with this file. If not, please write to:
# [email protected] to receive a copy
from abc import abstractmethod, ABC
from typing import Any

from wyzeapy import Client

Expand Down
12 changes: 6 additions & 6 deletions src/wyzeapy/services/hms_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from enum import Enum
from typing import Optional

from wyzeapy import Client, Wyzeapy
from wyzeapy import Client
from wyzeapy.services.base_service import BaseService


Expand Down Expand Up @@ -41,16 +41,16 @@ def hms_id(self) -> Optional[str]:
@property
async def has_hms(self):
if self._hms_id is None:
self._hms_id = await self.hms_id
self._hms_id = self.hms_id

return self._hms_id is not None

async def set_mode(self, mode: HMSMode):
if mode == HMSMode.DISARMED:
await self._client.net_client.disable_reme_alarm(await self.hms_id)
await self._client.net_client.monitoring_profile_active(await self.hms_id, 0, 0)
await self._client.net_client.disable_reme_alarm(self.hms_id)
await self._client.net_client.monitoring_profile_active(self.hms_id, 0, 0)
elif mode == HMSMode.AWAY:
await self._client.net_client.monitoring_profile_active(await self.hms_id, 0, 1)
await self._client.net_client.monitoring_profile_active(self.hms_id, 0, 1)
elif mode == HMSMode.HOME:
await self._client.net_client.monitoring_profile_active(await self.hms_id, 1, 0)
await self._client.net_client.monitoring_profile_active(self.hms_id, 1, 0)

1 change: 0 additions & 1 deletion src/wyzeapy/services/sensor_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ async def update(self, sensor: Sensor) -> Sensor:

return sensor


async def register_for_updates(self, sensor: Sensor, callback: Callable[[Sensor], None]):
if self._updater_thread is None:
self._updater_thread = Thread(target=self.update_worker, daemon=True)
Expand Down

0 comments on commit aab7a39

Please sign in to comment.