Rename VersatileThermostat with BaseThermostat. Tests ok

This commit is contained in:
Jean-Marc Collin
2023-10-22 16:54:38 +00:00
parent c9671a5c58
commit ae799adbd4
20 changed files with 2779 additions and 2714 deletions

View File

@@ -8,7 +8,7 @@ import logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .climate import VersatileThermostat
from .base_thermostat import BaseThermostat
from .const import DOMAIN, PLATFORMS

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ from homeassistant.helpers.entity import Entity
from homeassistant.helpers.device_registry import DeviceInfo, DeviceEntryType
from homeassistant.helpers.event import async_track_state_change_event, async_call_later
from .climate import VersatileThermostat
from .base_thermostat import BaseThermostat
from .const import DOMAIN, DEVICE_MANUFACTURER
_LOGGER = logging.getLogger(__name__)
@@ -17,7 +17,7 @@ _LOGGER = logging.getLogger(__name__)
class VersatileThermostatBaseEntity(Entity):
"""A base class for all entities"""
_my_climate: VersatileThermostat
_my_climate: BaseThermostat
hass: HomeAssistant
_config_id: str
_device_name: str
@@ -37,7 +37,7 @@ class VersatileThermostatBaseEntity(Entity):
return False
@property
def my_climate(self) -> VersatileThermostat | None:
def my_climate(self) -> BaseThermostat | None:
"""Returns my climate if found"""
if not self._my_climate:
self._my_climate = self.find_my_versatile_thermostat()
@@ -54,7 +54,7 @@ class VersatileThermostatBaseEntity(Entity):
model=DOMAIN,
)
def find_my_versatile_thermostat(self) -> VersatileThermostat:
def find_my_versatile_thermostat(self) -> BaseThermostat:
"""Find the underlying climate entity"""
try:
component: EntityComponent[ClimateEntity] = self.hass.data[CLIMATE_DOMAIN]

View File

@@ -0,0 +1,11 @@
""" A climate over switch classe """
from homeassistant.core import HomeAssistant
from .base_thermostat import BaseThermostat
class ThermostatOverClimate(BaseThermostat):
"""Representation of a base class for a Versatile Thermostat over a climate"""
def __init__(self, hass: HomeAssistant, unique_id, name, entry_infos) -> None:
"""Initialize the thermostat over switch."""
super().__init__(hass, unique_id, name, entry_infos)

View File

@@ -0,0 +1,13 @@
""" A climate over switch classe """
from homeassistant.core import HomeAssistant
from .base_thermostat import BaseThermostat
class ThermostatOverSwitch(BaseThermostat):
"""Representation of a base class for a Versatile Thermostat over a switch."""
def __init__(self, hass: HomeAssistant, unique_id, name, entry_infos) -> None:
"""Initialize the thermostat over switch."""
super().__init__(hass, unique_id, name, entry_infos)

View File

@@ -0,0 +1,11 @@
""" A climate over switch classe """
from homeassistant.core import HomeAssistant
from .base_thermostat import BaseThermostat
class ThermostatOverValve(BaseThermostat):
"""Representation of a class for a Versatile Thermostat over a Valve"""
def __init__(self, hass: HomeAssistant, unique_id, name, entry_infos) -> None:
"""Initialize the thermostat over switch."""
super().__init__(hass, unique_id, name, entry_infos)