Rename VersatileThermostat with BaseThermostat. Tests ok
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
2629
custom_components/versatile_thermostat/base_thermostat.py
Normal file
2629
custom_components/versatile_thermostat/base_thermostat.py
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -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]
|
||||
|
||||
11
custom_components/versatile_thermostat/thermostat_climate.py
Normal file
11
custom_components/versatile_thermostat/thermostat_climate.py
Normal 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)
|
||||
13
custom_components/versatile_thermostat/thermostat_switch.py
Normal file
13
custom_components/versatile_thermostat/thermostat_switch.py
Normal 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)
|
||||
11
custom_components/versatile_thermostat/thermostat_valve.py
Normal file
11
custom_components/versatile_thermostat/thermostat_valve.py
Normal 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)
|
||||
Reference in New Issue
Block a user