from typing import Protocol, runtime_checkable

from qolsys_controller.enum import QolsysFanMode, QolsysHvacAction, QolsysHvacMode, QolsysTemperatureUnit


@runtime_checkable
class ThermostatProtocol(Protocol):
    async def turn_on(self) -> None: ...
    async def turn_off(self) -> None: ...
    async def set_hvac_mode(self, hvac_mode: QolsysHvacMode) -> None: ...
    async def set_fan_mode(self, fan_mode: QolsysFanMode) -> None: ...
    async def set_humidity(self, humidity: float) -> None: ...
    async def set_temperature(self, temperature: float) -> None: ...

    def supports_target_temperature(self) -> bool: ...
    def supports_target_temperature_range(self) -> bool: ...
    def supports_humidity(self) -> bool: ...
    def supports_fan_mode(self) -> bool: ...
    def supports_turn_on(self) -> bool: ...
    def supports_turn_off(self) -> bool: ...

    @property
    def hvac_mode(self) -> QolsysHvacMode | None: ...

    @property
    def hvac_modes(self) -> list[QolsysHvacMode]: ...

    @property
    def hvac_action(self) -> QolsysHvacAction | None: ...

    @property
    def fan_mode(self) -> QolsysFanMode: ...

    @property
    def fan_modes(self) -> list[QolsysFanMode]: ...

    @property
    def current_temperature(self) -> float | None: ...

    @property
    def current_humidity(self) -> float | None: ...

    @property
    def device_temperature_unit(self) -> QolsysTemperatureUnit: ...

    @property
    def target_cool_temp(self) -> float | None: ...

    @property
    def target_heat_temp(self) -> float | None: ...

    @property
    def target_humidity(self) -> float | None: ...

    @property
    def target_temperature_step(self) -> float | None: ...

    @property
    def min_temperature(self) -> float | None: ...

    @property
    def max_temperature(self) -> float | None: ...

    @property
    def min_humidity(self) -> float | None: ...

    @property
    def max_humidity(self) -> float | None: ...
