Skip to content

Commit

Permalink
minor tweaks, rename to HotWater
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Dec 30, 2024
1 parent 0328327 commit 82e7e41
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 13 deletions.
30 changes: 29 additions & 1 deletion src/evohomeasync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import aiohttp

from .auth import AbstractSessionManager
from .exceptions import ( # noqa: F401
from .entities import ControlSystem, Gateway, HotWater, Location, Zone
from .exceptions import (
ApiRateLimitExceededError,
ApiRequestFailedError,
AuthenticationFailedError,
Expand Down Expand Up @@ -114,3 +115,30 @@ def __init__(
session_id=session_id,
)
super().__init__(self._session_manager, debug=debug)


__all__ = [ # noqa: RUF022
"EvohomeClient",
"AbstractSessionManager",
#
"Location",
"Gateway",
"ControlSystem",
"Zone",
"HotWater",
#
"ApiRateLimitExceededError",
"ApiRequestFailedError",
"AuthenticationFailedError",
"BadApiRequestError",
"BadApiResponseError",
"BadApiSchemaError",
"BadScheduleUploadedError",
"ConfigError",
"EvohomeError",
"InvalidConfigError",
"InvalidScheduleError",
"InvalidStatusError",
"NoSingleTcsError",
"StatusError",
]
8 changes: 4 additions & 4 deletions src/evohomeasync/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _update_status(self, status: EvoDevInfoDictT | EvoGwyInfoDictT) -> None:
self._status = status


class Hotwater(_DeviceBase): # Hotwater version of a Device
class HotWater(_DeviceBase): # Hotwater version of a Device
"""Instance of a location's DHW zone."""

_config: Final[EvoDevInfoDictT] # type: ignore[misc]
Expand Down Expand Up @@ -269,7 +269,7 @@ class ControlSystem(_EntityBase): # TCS portion of a Location
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)

self.hotwater: Hotwater | None = None
self.hotwater: HotWater | None = None
self.zones: list[Zone] = []

self.zone_by_id: dict[str, Zone] = {} # id is fixed to zone
Expand Down Expand Up @@ -352,7 +352,7 @@ def _get_zone(self, zon_id: int | str) -> Zone:

return dev

def _get_dhw(self) -> Hotwater:
def _get_dhw(self) -> HotWater:
"""Return the TCS's DHW, if there is one."""

dev = self.zone_by_id.get("HW")
Expand Down Expand Up @@ -416,7 +416,7 @@ def __init__(self, client: EvohomeClient, config: EvoTcsInfoDictT) -> None:
self.gateway_by_id[gwy.id] = gwy

if dev_config["thermostat_model_type"] == "DOMESTIC_HOT_WATER":
self.hotwater = Hotwater(self, dev_config)
self.hotwater = HotWater(self, dev_config)

elif dev_config["thermostat_model_type"].startswith("EMEA_"):
self._add_zone(Zone(self, dev_config))
Expand Down
19 changes: 18 additions & 1 deletion src/evohomeasync/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from evohome.exceptions import ( # noqa: F401
from evohome.exceptions import (
ApiRateLimitExceededError,
ApiRequestFailedError,
AuthenticationFailedError,
Expand All @@ -18,3 +18,20 @@
NoSingleTcsError,
StatusError,
)

__all__ = [
"ApiRateLimitExceededError",
"ApiRequestFailedError",
"AuthenticationFailedError",
"BadApiRequestError",
"BadApiResponseError",
"BadApiSchemaError",
"BadScheduleUploadedError",
"ConfigError",
"EvohomeError",
"InvalidConfigError",
"InvalidScheduleError",
"InvalidStatusError",
"NoSingleTcsError",
"StatusError",
]
39 changes: 33 additions & 6 deletions src/evohomeasync2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import aiohttp

from .auth import AbstractTokenManager
from .control_system import ControlSystem # noqa: F401
from .exceptions import ( # noqa: F401
from .control_system import ControlSystem
from .exceptions import (
ApiRateLimitExceededError,
ApiRequestFailedError,
AuthenticationFailedError,
Expand All @@ -29,11 +29,11 @@
NoSingleTcsError,
StatusError,
)
from .gateway import Gateway # noqa: F401
from .hotwater import HotWater # noqa: F401
from .location import Location # noqa: F401
from .gateway import Gateway
from .hotwater import HotWater
from .location import Location
from .main import EvohomeClient
from .zone import Zone # noqa: F401
from .zone import Zone

__version__ = "1.2.0"

Expand Down Expand Up @@ -119,3 +119,30 @@ def refresh_token(self) -> str:
def username(self) -> str:
"""Return the username attr."""
return self._token_manager.client_id


__all__ = [ # noqa: RUF022
"EvohomeClient",
"AbstractTokenManager",
#
"Location",
"Gateway",
"ControlSystem",
"Zone",
"HotWater",
#
"ApiRateLimitExceededError",
"ApiRequestFailedError",
"AuthenticationFailedError",
"BadApiRequestError",
"BadApiResponseError",
"BadApiSchemaError",
"BadScheduleUploadedError",
"ConfigError",
"EvohomeError",
"InvalidConfigError",
"InvalidScheduleError",
"InvalidStatusError",
"NoSingleTcsError",
"StatusError",
]
19 changes: 18 additions & 1 deletion src/evohomeasync2/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from evohome.exceptions import ( # noqa: F401
from evohome.exceptions import (
ApiRateLimitExceededError,
ApiRequestFailedError,
AuthenticationFailedError,
Expand All @@ -18,3 +18,20 @@
NoSingleTcsError,
StatusError,
)

__all__ = [
"ApiRateLimitExceededError",
"ApiRequestFailedError",
"AuthenticationFailedError",
"BadApiRequestError",
"BadApiResponseError",
"BadApiSchemaError",
"BadScheduleUploadedError",
"ConfigError",
"EvohomeError",
"InvalidConfigError",
"InvalidScheduleError",
"InvalidStatusError",
"NoSingleTcsError",
"StatusError",
]

0 comments on commit 82e7e41

Please sign in to comment.