Skip to content

Commit

Permalink
small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Dec 15, 2024
1 parent b6ec2c3 commit 3e077a1
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/evohomeasync2/control_system.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Provides handling of TCC temperature control systems."""

# TODO: add set_mode() for non-evohome modes (e.g. "Heat", "Off")
# TODO: extend set_mode() for non-evohome modes (e.g. "Heat", "Off")

from __future__ import annotations

Expand Down Expand Up @@ -242,7 +242,7 @@ async def set_heatingoff(self, /, *, until: dt | None = None) -> None:

async def get_temperatures(
self,
) -> list[dict[str, float | str | None]]: # TODO: remove?
) -> list[dict[str, float | str | None]]: # TODO: remove this convenience function?
"""A convenience function to return the latest temperatures and setpoints."""

await self.location.update()
Expand Down
2 changes: 1 addition & 1 deletion src/evohomeasync2/hotwater.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Provides handling of TCC DHW zones."""

# TODO: add set_mode() for non-evohome modes
# TODO: extend set_mode() for non-evohome modes

from __future__ import annotations

Expand Down
6 changes: 3 additions & 3 deletions src/evohomeasync2/schemas/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ def factory_dhw(fnc: Callable[[str], str] = noop) -> vol.Schema:

SCH_DHW_STATE_CAPABILITIES_RESPONSE: Final = vol.Schema(
{
# TODO: value should be a *subset* of the list of all possible DhwState(s)
# TODO: list should be a non-empty *subset* of all possible DhwState(s)
vol.Required(fnc(S2_ALLOWED_STATES)): [m.value for m in DhwState],
# TODO: value should be a *subset* of the list of all possible ZoneMode(s)
# TODO: list should be a non-empty *subset* of all possible ZoneMode(s)
vol.Required(fnc(S2_ALLOWED_MODES)): [m.value for m in ZoneMode],
vol.Required(fnc(S2_MAX_DURATION)): str,
vol.Required(fnc(S2_TIMING_RESOLUTION)): vol.Datetime(format="00:%M:00"),
Expand Down Expand Up @@ -224,7 +224,7 @@ def factory_zone(fnc: Callable[[str], str] = noop) -> vol.Schema:
vol.Required(fnc(S2_CAN_CONTROL_COOL)): bool,
vol.Optional(fnc(S2_MAX_COOL_SETPOINT)): float, # TODO
vol.Optional(fnc(S2_MIN_COOL_SETPOINT)): float, # TODO
# TODO: value should be a *subset* of the list of all possible ZoneMode(s)
# TODO: list should be a non-empty *subset* of all possible ZoneMode(s)
vol.Required(fnc(S2_ALLOWED_SETPOINT_MODES)): [m.value for m in ZoneMode],
vol.Required(fnc(S2_VALUE_RESOLUTION)): float, # 0.5
vol.Required(fnc(S2_MAX_DURATION)): str, # "1.00:00:00"
Expand Down
3 changes: 1 addition & 2 deletions src/evohomeasync2/zone.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Provides handling of TCC zones (heating and DHW)."""

# TODO: add provision for cooling zones, when vendor's API adds support for such
# TODO: add set_mode() for non-evohome modes (e.g. "VacationHold")
# TODO: extend set_mode() for non-evohome modes (e.g. "VacationHold")

from __future__ import annotations

Expand Down
2 changes: 0 additions & 2 deletions tests/tests_rf/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ async def wait_for_comm_task_v2(auth: evo2.auth.Auth, task_id: str) -> bool:
# async with asyncio.timeout(2):
# await wait_for_comm_task()

rsp: aiohttp.ClientResponse # TODO: shouldn't be needed; isn't via async with

url = f"commTasks?commTaskId={task_id}"

while True:
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_rf/test_v0_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def _test_usr_locations(evo: EvohomeClientv0) -> None:
# loc_id: int = evo.location_id

url = f"locations?userId={usr_id}&allData=True"
_ = await should_work_v0(evo.auth, HTTPMethod.GET, url) # TODO: add schema
_ = await should_work_v0(evo.auth, HTTPMethod.GET, url) # FIXME: add schema

# why isn't this one METHOD_NOT_ALLOWED?
_ = await should_fail_v0(evo.auth, HTTPMethod.PUT, url, status=HTTPStatus.NOT_FOUND)
Expand Down
13 changes: 0 additions & 13 deletions tests/tests_rf/test_v2_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import evohomeasync2 as evo2
from evohome.helpers import camel_to_pascal
from evohomeasync2 import ControlSystem, Gateway, HotWater, Location, Zone
from evohomeasync2.const import API_STRFTIME, DhwState, ZoneMode
from evohomeasync2.schemas.const import (
S2_MODE,
Expand All @@ -44,14 +43,8 @@ async def _test_task_id_dhw(evo: EvohomeClientv2) -> None:
This test can be used to prove that JSON keys are can be camelCase or PascalCase.
"""

loc: Location
gwy: Gateway
tcs: ControlSystem

await evo.update(_dont_update_status=True)

dhw: HotWater | None = None

for loc in evo.locations:
for gwy in loc.gateways:
for tcs in gwy.control_systems:
Expand Down Expand Up @@ -208,14 +201,8 @@ async def _test_task_id_zone(evo: EvohomeClientv2) -> None:
This test can be used to prove that JSON keys are can be camelCase or PascalCase.
"""

loc: Location
gwy: Gateway
tcs: ControlSystem

await evo.update(_dont_update_status=True)

zone: Zone | None = None

for loc in evo.locations:
for gwy in loc.gateways:
for tcs in gwy.control_systems:
Expand Down
3 changes: 1 addition & 2 deletions tests/tests_rf/test_v2_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,7 @@ async def _test_zone_status(evo: EvohomeClientv2) -> None:
Also tests /temperatureZone/{zone.id}/heatSetpoint
"""

zone: evo2.Zone
heat_setpoint: dict[str, float | str | None]
heat_setpoint: dict[str, float | str | None] # TODO: TypedDict

# TODO: remove .update() and use URLs only
await evo.update(_dont_update_status=True)
Expand Down

0 comments on commit 3e077a1

Please sign in to comment.