mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Rename ClimateDevice to ClimateEntity (#34591)
This commit is contained in:
parent
b30d117e7d
commit
29bc93ea98
@ -5,7 +5,7 @@ import logging
|
||||
import ambiclimate
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
@ -130,7 +130,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
|
||||
)
|
||||
|
||||
|
||||
class AmbiclimateEntity(ClimateDevice):
|
||||
class AmbiclimateEntity(ClimateEntity):
|
||||
"""Representation of a Ambiclimate Thermostat device."""
|
||||
|
||||
def __init__(self, heater, store):
|
||||
|
@ -101,7 +101,7 @@ SET_TEMPERATURE_SCHEMA = vol.All(
|
||||
|
||||
|
||||
async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
|
||||
"""Set up climate devices."""
|
||||
"""Set up climate entities."""
|
||||
component = hass.data[DOMAIN] = EntityComponent(
|
||||
_LOGGER, DOMAIN, hass, SCAN_INTERVAL
|
||||
)
|
||||
@ -156,8 +156,8 @@ async def async_unload_entry(hass: HomeAssistantType, entry):
|
||||
return await hass.data[DOMAIN].async_unload_entry(entry)
|
||||
|
||||
|
||||
class ClimateDevice(Entity):
|
||||
"""Representation of a climate device."""
|
||||
class ClimateEntity(Entity):
|
||||
"""Representation of a climate entity."""
|
||||
|
||||
@property
|
||||
def state(self) -> str:
|
||||
@ -509,7 +509,7 @@ class ClimateDevice(Entity):
|
||||
|
||||
|
||||
async def async_service_aux_heat(
|
||||
entity: ClimateDevice, service: ServiceDataType
|
||||
entity: ClimateEntity, service: ServiceDataType
|
||||
) -> None:
|
||||
"""Handle aux heat service."""
|
||||
if service.data[ATTR_AUX_HEAT]:
|
||||
@ -519,7 +519,7 @@ async def async_service_aux_heat(
|
||||
|
||||
|
||||
async def async_service_temperature_set(
|
||||
entity: ClimateDevice, service: ServiceDataType
|
||||
entity: ClimateEntity, service: ServiceDataType
|
||||
) -> None:
|
||||
"""Handle set temperature service."""
|
||||
hass = entity.hass
|
||||
@ -534,3 +534,15 @@ async def async_service_temperature_set(
|
||||
kwargs[value] = temp
|
||||
|
||||
await entity.async_set_temperature(**kwargs)
|
||||
|
||||
|
||||
class ClimateDevice(ClimateEntity):
|
||||
"""Representation of a climate entity (for backwards compatibility)."""
|
||||
|
||||
def __init_subclass__(cls, **kwargs):
|
||||
"""Print deprecation warning."""
|
||||
super().__init_subclass__(**kwargs)
|
||||
_LOGGER.warning(
|
||||
"ClimateDevice is deprecated, modify %s to extend ClimateEntity",
|
||||
cls.__name__,
|
||||
)
|
||||
|
@ -4,7 +4,7 @@ import logging
|
||||
|
||||
from pycoolmasternet import CoolMasterNet
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_COOL,
|
||||
HVAC_MODE_DRY,
|
||||
@ -60,7 +60,7 @@ async def async_setup_entry(hass, config_entry, async_add_devices):
|
||||
async_add_devices(all_devices, True)
|
||||
|
||||
|
||||
class CoolmasterClimate(ClimateDevice):
|
||||
class CoolmasterClimate(ClimateEntity):
|
||||
"""Representation of a coolmaster climate device."""
|
||||
|
||||
def __init__(self, device, supported_modes):
|
||||
|
@ -4,7 +4,7 @@ import logging
|
||||
from pydaikin import appliance
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_FAN_MODE,
|
||||
ATTR_HVAC_MODE,
|
||||
@ -86,7 +86,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
|
||||
async_add_entities([DaikinClimate(daikin_api)], update_before_add=True)
|
||||
|
||||
|
||||
class DaikinClimate(ClimateDevice):
|
||||
class DaikinClimate(ClimateEntity):
|
||||
"""Representation of a Daikin HVAC."""
|
||||
|
||||
def __init__(self, api):
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Support for deCONZ climate devices."""
|
||||
from pydeconz.sensor import Thermostat
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_AUTO,
|
||||
HVAC_MODE_HEAT,
|
||||
@ -58,7 +58,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
async_add_climate(gateway.api.sensors.values())
|
||||
|
||||
|
||||
class DeconzThermostat(DeconzDevice, ClimateDevice):
|
||||
class DeconzThermostat(DeconzDevice, ClimateEntity):
|
||||
"""Representation of a deCONZ thermostat."""
|
||||
|
||||
@property
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Demo platform that offers a fake climate device."""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
@ -97,7 +97,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
await async_setup_platform(hass, {}, async_add_entities)
|
||||
|
||||
|
||||
class DemoClimate(ClimateDevice):
|
||||
class DemoClimate(ClimateEntity):
|
||||
"""Representation of a demo climate device."""
|
||||
|
||||
def __init__(
|
||||
|
@ -5,7 +5,7 @@ from libpurecool.const import FocusMode, HeatMode, HeatState, HeatTarget
|
||||
from libpurecool.dyson_pure_hotcool_link import DysonPureHotCoolLink
|
||||
from libpurecool.dyson_pure_state import DysonPureHotCoolState
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_COOL,
|
||||
CURRENT_HVAC_HEAT,
|
||||
@ -43,7 +43,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
)
|
||||
|
||||
|
||||
class DysonPureHotCoolLinkDevice(ClimateDevice):
|
||||
class DysonPureHotCoolLinkDevice(ClimateEntity):
|
||||
"""Representation of a Dyson climate fan."""
|
||||
|
||||
def __init__(self, device):
|
||||
|
@ -4,7 +4,7 @@ from typing import Optional
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
@ -249,7 +249,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
)
|
||||
|
||||
|
||||
class Thermostat(ClimateDevice):
|
||||
class Thermostat(ClimateEntity):
|
||||
"""A thermostat class for Ecobee."""
|
||||
|
||||
def __init__(self, data, thermostat_index):
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Support for control of Elk-M1 connected thermostats."""
|
||||
from elkm1_lib.const import ThermostatFan, ThermostatMode, ThermostatSetting
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
@ -39,7 +39,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
async_add_entities(entities, True)
|
||||
|
||||
|
||||
class ElkThermostat(ElkEntity, ClimateDevice):
|
||||
class ElkThermostat(ElkEntity, ClimateEntity):
|
||||
"""Representation of an Elk-M1 Thermostat."""
|
||||
|
||||
def __init__(self, element, elk, elk_data):
|
||||
|
@ -15,7 +15,7 @@ from pyephember.pyephember import (
|
||||
)
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -70,7 +70,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
return
|
||||
|
||||
|
||||
class EphEmberThermostat(ClimateDevice):
|
||||
class EphEmberThermostat(ClimateEntity):
|
||||
"""Representation of a EphEmber thermostat."""
|
||||
|
||||
def __init__(self, ember, zone):
|
||||
|
@ -6,7 +6,7 @@ from bluepy.btle import BTLEException
|
||||
import eq3bt as eq3 # pylint: disable=import-error
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_AUTO,
|
||||
HVAC_MODE_HEAT,
|
||||
@ -76,7 +76,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities(devices, True)
|
||||
|
||||
|
||||
class EQ3BTSmartThermostat(ClimateDevice):
|
||||
class EQ3BTSmartThermostat(ClimateEntity):
|
||||
"""Representation of an eQ-3 Bluetooth Smart thermostat."""
|
||||
|
||||
def __init__(self, _mac, _name):
|
||||
|
@ -11,7 +11,7 @@ from aioesphomeapi import (
|
||||
ClimateSwingMode,
|
||||
)
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_HVAC_MODE,
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
@ -75,7 +75,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
|
||||
async_add_entities,
|
||||
component_key="climate",
|
||||
info_type=ClimateInfo,
|
||||
entity_type=EsphomeClimateDevice,
|
||||
entity_type=EsphomeClimateEntity,
|
||||
state_type=ClimateState,
|
||||
)
|
||||
|
||||
@ -129,7 +129,7 @@ def _swing_modes():
|
||||
}
|
||||
|
||||
|
||||
class EsphomeClimateDevice(EsphomeEntity, ClimateDevice):
|
||||
class EsphomeClimateEntity(EsphomeEntity, ClimateEntity):
|
||||
"""A climate implementation for ESPHome."""
|
||||
|
||||
@property
|
||||
|
@ -3,7 +3,7 @@ from datetime import datetime as dt
|
||||
import logging
|
||||
from typing import List, Optional
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -122,7 +122,7 @@ async def async_setup_platform(
|
||||
async_add_entities([controller] + zones, update_before_add=True)
|
||||
|
||||
|
||||
class EvoClimateDevice(EvoDevice, ClimateDevice):
|
||||
class EvoClimateEntity(EvoDevice, ClimateEntity):
|
||||
"""Base for an evohome Climate device."""
|
||||
|
||||
def __init__(self, evo_broker, evo_device) -> None:
|
||||
@ -142,7 +142,7 @@ class EvoClimateDevice(EvoDevice, ClimateDevice):
|
||||
return self._preset_modes
|
||||
|
||||
|
||||
class EvoZone(EvoChild, EvoClimateDevice):
|
||||
class EvoZone(EvoChild, EvoClimateEntity):
|
||||
"""Base for a Honeywell TCC Zone."""
|
||||
|
||||
def __init__(self, evo_broker, evo_device) -> None:
|
||||
@ -315,7 +315,7 @@ class EvoZone(EvoChild, EvoClimateDevice):
|
||||
self._device_state_attrs[attr] = getattr(self._evo_device, attr)
|
||||
|
||||
|
||||
class EvoController(EvoClimateDevice):
|
||||
class EvoController(EvoClimateEntity):
|
||||
"""Base for a Honeywell TCC Controller/Location.
|
||||
|
||||
The Controller (aka TCS, temperature control system) is the parent of all the child
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Support for Fibaro thermostats."""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_AUTO,
|
||||
HVAC_MODE_COOL,
|
||||
@ -104,7 +104,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
)
|
||||
|
||||
|
||||
class FibaroThermostat(FibaroDevice, ClimateDevice):
|
||||
class FibaroThermostat(FibaroDevice, ClimateEntity):
|
||||
"""Representation of a Fibaro Thermostat."""
|
||||
|
||||
def __init__(self, fibaro_device):
|
||||
|
@ -5,7 +5,7 @@ from typing import List
|
||||
from pyflexit.pyflexit import pyflexit
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_COOL,
|
||||
SUPPORT_FAN_MODE,
|
||||
@ -42,7 +42,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities([Flexit(hub, modbus_slave, name)], True)
|
||||
|
||||
|
||||
class Flexit(ClimateDevice):
|
||||
class Flexit(ClimateEntity):
|
||||
"""Representation of a Flexit AC unit."""
|
||||
|
||||
def __init__(self, hub, modbus_slave, name):
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Support for AVM Fritz!Box smarthome thermostate devices."""
|
||||
import requests
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_HVAC_MODE,
|
||||
HVAC_MODE_HEAT,
|
||||
@ -61,7 +61,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
class FritzboxThermostat(ClimateDevice):
|
||||
class FritzboxThermostat(ClimateEntity):
|
||||
"""The thermostat class for Fritzbox smarthome thermostates."""
|
||||
|
||||
def __init__(self, device, fritz):
|
||||
|
@ -4,7 +4,7 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_PRESET_MODE,
|
||||
CURRENT_HVAC_COOL,
|
||||
@ -127,7 +127,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
)
|
||||
|
||||
|
||||
class GenericThermostat(ClimateDevice, RestoreEntity):
|
||||
class GenericThermostat(ClimateEntity, RestoreEntity):
|
||||
"""Representation of a Generic Thermostat device."""
|
||||
|
||||
def __init__(
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Support for Genius Hub climate devices."""
|
||||
from typing import List, Optional
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -45,7 +45,7 @@ async def async_setup_platform(
|
||||
)
|
||||
|
||||
|
||||
class GeniusClimateZone(GeniusHeatingZone, ClimateDevice):
|
||||
class GeniusClimateZone(GeniusHeatingZone, ClimateEntity):
|
||||
"""Representation of a Genius Hub climate device."""
|
||||
|
||||
def __init__(self, broker, zone) -> None:
|
||||
|
@ -9,7 +9,7 @@ from homeassistant.components.climate import (
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
PLATFORM_SCHEMA,
|
||||
ClimateDevice,
|
||||
ClimateEntity,
|
||||
)
|
||||
from homeassistant.components.climate.const import SUPPORT_TARGET_TEMPERATURE
|
||||
from homeassistant.const import (
|
||||
@ -64,7 +64,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
)
|
||||
|
||||
|
||||
class HeatmiserV3Thermostat(ClimateDevice):
|
||||
class HeatmiserV3Thermostat(ClimateEntity):
|
||||
"""Representation of a HeatmiserV3 thermostat."""
|
||||
|
||||
def __init__(self, therm, device, uh1):
|
||||
|
@ -5,7 +5,7 @@ import logging
|
||||
from pyaehw4a1.aehw4a1 import AehW4a1
|
||||
import pyaehw4a1.exceptions
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
FAN_AUTO,
|
||||
FAN_HIGH,
|
||||
@ -144,7 +144,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
async_add_entities(entities, True)
|
||||
|
||||
|
||||
class ClimateAehW4a1(ClimateDevice):
|
||||
class ClimateAehW4a1(ClimateEntity):
|
||||
"""Representation of a Hisense AEH-W4A1 module for climate device."""
|
||||
|
||||
def __init__(self, device):
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""Support for the Hive climate devices."""
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -51,7 +51,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities(devs)
|
||||
|
||||
|
||||
class HiveClimateEntity(HiveEntity, ClimateDevice):
|
||||
class HiveClimateEntity(HiveEntity, ClimateEntity):
|
||||
"""Hive Climate Device."""
|
||||
|
||||
def __init__(self, hive_session, hive_device):
|
||||
|
@ -11,7 +11,7 @@ from aiohomekit.utils import clamp_enum_to_char
|
||||
from homeassistant.components.climate import (
|
||||
DEFAULT_MAX_HUMIDITY,
|
||||
DEFAULT_MIN_HUMIDITY,
|
||||
ClimateDevice,
|
||||
ClimateEntity,
|
||||
)
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_COOL,
|
||||
@ -59,13 +59,13 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
if service["stype"] != "thermostat":
|
||||
return False
|
||||
info = {"aid": aid, "iid": service["iid"]}
|
||||
async_add_entities([HomeKitClimateDevice(conn, info)], True)
|
||||
async_add_entities([HomeKitClimateEntity(conn, info)], True)
|
||||
return True
|
||||
|
||||
conn.add_listener(async_add_service)
|
||||
|
||||
|
||||
class HomeKitClimateDevice(HomeKitEntity, ClimateDevice):
|
||||
class HomeKitClimateEntity(HomeKitEntity, ClimateEntity):
|
||||
"""Representation of a Homekit climate device."""
|
||||
|
||||
def get_characteristic_types(self):
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Support for Homematic thermostats."""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_AUTO,
|
||||
HVAC_MODE_HEAT,
|
||||
@ -48,7 +48,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities(devices, True)
|
||||
|
||||
|
||||
class HMThermostat(HMDevice, ClimateDevice):
|
||||
class HMThermostat(HMDevice, ClimateEntity):
|
||||
"""Representation of a Homematic thermostat."""
|
||||
|
||||
@property
|
||||
|
@ -8,7 +8,7 @@ from homematicip.base.enums import AbsenceType
|
||||
from homematicip.device import Switch
|
||||
from homematicip.functionalHomes import IndoorClimateHome
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -57,7 +57,7 @@ async def async_setup_entry(
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
class HomematicipHeatingGroup(HomematicipGenericDevice, ClimateDevice):
|
||||
class HomematicipHeatingGroup(HomematicipGenericDevice, ClimateEntity):
|
||||
"""Representation of a HomematicIP heating group.
|
||||
|
||||
Heat mode is supported for all heating devices incl. their defined profiles.
|
||||
|
@ -7,7 +7,7 @@ import requests
|
||||
import somecomfort
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
@ -145,7 +145,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
)
|
||||
|
||||
|
||||
class HoneywellUSThermostat(ClimateDevice):
|
||||
class HoneywellUSThermostat(ClimateEntity):
|
||||
"""Representation of a Honeywell US Thermostat."""
|
||||
|
||||
def __init__(
|
||||
|
@ -10,7 +10,7 @@ from iaqualink.const import (
|
||||
AQUALINK_TEMP_FAHRENHEIT_LOW,
|
||||
)
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
DOMAIN,
|
||||
HVAC_MODE_HEAT,
|
||||
@ -39,7 +39,7 @@ async def async_setup_entry(
|
||||
async_add_entities(devs, True)
|
||||
|
||||
|
||||
class HassAqualinkThermostat(AqualinkEntity, ClimateDevice):
|
||||
class HassAqualinkThermostat(AqualinkEntity, ClimateEntity):
|
||||
"""Representation of a thermostat."""
|
||||
|
||||
@property
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Support for an Intergas boiler via an InComfort/InTouch Lan2RF gateway."""
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN, ClimateDevice
|
||||
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_HEAT,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
@ -24,7 +24,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
)
|
||||
|
||||
|
||||
class InComfortClimate(IncomfortChild, ClimateDevice):
|
||||
class InComfortClimate(IncomfortChild, ClimateEntity):
|
||||
"""Representation of an InComfort/InTouch climate device."""
|
||||
|
||||
def __init__(self, client, heater, room) -> None:
|
||||
|
@ -5,7 +5,7 @@ from random import randrange
|
||||
from pyintesishome import IHAuthenticationError, IHConnectionError, IntesisHome
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_HVAC_MODE,
|
||||
HVAC_MODE_COOL,
|
||||
@ -129,7 +129,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
await controller.stop()
|
||||
|
||||
|
||||
class IntesisAC(ClimateDevice):
|
||||
class IntesisAC(ClimateEntity):
|
||||
"""Represents an Intesishome air conditioning device."""
|
||||
|
||||
def __init__(self, ih_device_id, ih_device, controller):
|
||||
|
@ -4,7 +4,7 @@ from typing import List, Optional
|
||||
|
||||
from pizone import Controller, Zone
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
FAN_AUTO,
|
||||
FAN_HIGH,
|
||||
@ -100,7 +100,7 @@ def _return_on_connection_error(ret=None):
|
||||
return wrap
|
||||
|
||||
|
||||
class ControllerDevice(ClimateDevice):
|
||||
class ControllerDevice(ClimateEntity):
|
||||
"""Representation of iZone Controller."""
|
||||
|
||||
def __init__(self, controller: Controller) -> None:
|
||||
@ -399,7 +399,7 @@ class ControllerDevice(ClimateDevice):
|
||||
await self.wrap_and_catch(self._controller.set_on(True))
|
||||
|
||||
|
||||
class ZoneDevice(ClimateDevice):
|
||||
class ZoneDevice(ClimateEntity):
|
||||
"""Representation of iZone Zone."""
|
||||
|
||||
def __init__(self, controller: ControllerDevice, zone: Zone) -> None:
|
||||
|
@ -5,7 +5,7 @@ import voluptuous as vol
|
||||
from xknx.devices import Climate as XknxClimate, ClimateMode as XknxClimateMode
|
||||
from xknx.knx import HVACOperationMode
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_AUTO,
|
||||
HVAC_MODE_COOL,
|
||||
@ -192,7 +192,7 @@ def async_add_entities_config(hass, config, async_add_entities):
|
||||
async_add_entities([KNXClimate(climate)])
|
||||
|
||||
|
||||
class KNXClimate(ClimateDevice):
|
||||
class KNXClimate(ClimateEntity):
|
||||
"""Representation of a KNX climate device."""
|
||||
|
||||
def __init__(self, device):
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import pypck
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice, const
|
||||
from homeassistant.components.climate import ClimateEntity, const
|
||||
from homeassistant.const import ATTR_TEMPERATURE, CONF_ADDRESS, CONF_UNIT_OF_MEASUREMENT
|
||||
|
||||
from . import LcnDevice
|
||||
@ -38,7 +38,7 @@ async def async_setup_platform(
|
||||
async_add_entities(devices)
|
||||
|
||||
|
||||
class LcnClimate(LcnDevice, ClimateDevice):
|
||||
class LcnClimate(LcnDevice, ClimateEntity):
|
||||
"""Representation of a LCN climate device."""
|
||||
|
||||
def __init__(self, config, address_connection):
|
||||
|
@ -5,7 +5,7 @@ from homeassistant.components.climate import (
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
ClimateDevice,
|
||||
ClimateEntity,
|
||||
)
|
||||
from homeassistant.components.climate.const import CURRENT_HVAC_HEAT, CURRENT_HVAC_OFF
|
||||
from homeassistant.const import ATTR_TEMPERATURE, CONF_NAME, TEMP_CELSIUS
|
||||
@ -29,7 +29,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
class LightwaveTrv(ClimateDevice):
|
||||
class LightwaveTrv(ClimateEntity):
|
||||
"""Representation of a LightWaveRF TRV."""
|
||||
|
||||
def __init__(self, name, device_id, lwlink, serial):
|
||||
|
@ -9,7 +9,7 @@ from maxcube.device import (
|
||||
MAX_DEVICE_MODE_VACATION,
|
||||
)
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -72,11 +72,11 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities(devices)
|
||||
|
||||
|
||||
class MaxCubeClimate(ClimateDevice):
|
||||
"""MAX! Cube ClimateDevice."""
|
||||
class MaxCubeClimate(ClimateEntity):
|
||||
"""MAX! Cube ClimateEntity."""
|
||||
|
||||
def __init__(self, handler, name, rf_address):
|
||||
"""Initialize MAX! Cube ClimateDevice."""
|
||||
"""Initialize MAX! Cube ClimateEntity."""
|
||||
self._name = name
|
||||
self._rf_address = rf_address
|
||||
self._cubehandle = handler
|
||||
|
@ -13,7 +13,7 @@ from pymelcloud.atw_device import (
|
||||
)
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
DEFAULT_MAX_TEMP,
|
||||
DEFAULT_MIN_TEMP,
|
||||
@ -100,7 +100,7 @@ async def async_setup_entry(
|
||||
)
|
||||
|
||||
|
||||
class MelCloudClimate(ClimateDevice):
|
||||
class MelCloudClimate(ClimateEntity):
|
||||
"""Base climate device."""
|
||||
|
||||
def __init__(self, device: MelCloudDevice):
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Support for Melissa Climate A/C."""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
FAN_AUTO,
|
||||
FAN_HIGH,
|
||||
@ -49,7 +49,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
async_add_entities(all_devices)
|
||||
|
||||
|
||||
class MelissaClimate(ClimateDevice):
|
||||
class MelissaClimate(ClimateEntity):
|
||||
"""Representation of a Melissa Climate device."""
|
||||
|
||||
def __init__(self, api, serial_number, init_data):
|
||||
|
@ -4,7 +4,7 @@ import logging
|
||||
from mill import Mill
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -85,7 +85,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
)
|
||||
|
||||
|
||||
class MillHeater(ClimateDevice):
|
||||
class MillHeater(ClimateEntity):
|
||||
"""Representation of a Mill Thermostat device."""
|
||||
|
||||
def __init__(self, heater, mill_data_connection):
|
||||
|
@ -7,7 +7,7 @@ from pymodbus.exceptions import ConnectionException, ModbusException
|
||||
from pymodbus.pdu import ExceptionResponse
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_AUTO,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
@ -115,7 +115,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
)
|
||||
|
||||
|
||||
class ModbusThermostat(ClimateDevice):
|
||||
class ModbusThermostat(ClimateEntity):
|
||||
"""Representation of a Modbus Thermostat."""
|
||||
|
||||
def __init__(
|
||||
|
@ -6,7 +6,7 @@ import voluptuous as vol
|
||||
from homeassistant.components import climate, mqtt
|
||||
from homeassistant.components.climate import (
|
||||
PLATFORM_SCHEMA as CLIMATE_PLATFORM_SCHEMA,
|
||||
ClimateDevice,
|
||||
ClimateEntity,
|
||||
)
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_HVAC_MODE,
|
||||
@ -273,7 +273,7 @@ class MqttClimate(
|
||||
MqttAvailability,
|
||||
MqttDiscoveryUpdate,
|
||||
MqttEntityDeviceInfo,
|
||||
ClimateDevice,
|
||||
ClimateEntity,
|
||||
):
|
||||
"""Representation of an MQTT climate device."""
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
"""MySensors platform that offers a Climate (MySensors-HVAC) component."""
|
||||
from homeassistant.components import mysensors
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
@ -43,7 +43,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
)
|
||||
|
||||
|
||||
class MySensorsHVAC(mysensors.device.MySensorsEntity, ClimateDevice):
|
||||
class MySensorsHVAC(mysensors.device.MySensorsEntity, ClimateEntity):
|
||||
"""Representation of a MySensors HVAC."""
|
||||
|
||||
@property
|
||||
|
@ -4,7 +4,7 @@ import logging
|
||||
from nest.nest import APIError
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
@ -88,7 +88,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
|
||||
async_add_entities(all_devices, True)
|
||||
|
||||
|
||||
class NestThermostat(ClimateDevice):
|
||||
class NestThermostat(ClimateEntity):
|
||||
"""Representation of a Nest thermostat."""
|
||||
|
||||
def __init__(self, structure, device, temp_unit):
|
||||
|
@ -7,7 +7,7 @@ import pyatmo
|
||||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -156,7 +156,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
return
|
||||
|
||||
|
||||
class NetatmoThermostat(ClimateDevice):
|
||||
class NetatmoThermostat(ClimateEntity):
|
||||
"""Representation a Netatmo thermostat."""
|
||||
|
||||
def __init__(self, data, room_id):
|
||||
|
@ -13,7 +13,7 @@ from nexia.const import (
|
||||
)
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_HUMIDITY,
|
||||
ATTR_MAX_HUMIDITY,
|
||||
@ -133,7 +133,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
async_add_entities(entities, True)
|
||||
|
||||
|
||||
class NexiaZone(NexiaThermostatZoneEntity, ClimateDevice):
|
||||
class NexiaZone(NexiaThermostatZoneEntity, ClimateEntity):
|
||||
"""Provides Nexia Climate support."""
|
||||
|
||||
def __init__(self, coordinator, zone):
|
||||
|
@ -11,7 +11,7 @@ from nuheat.util import (
|
||||
nuheat_to_fahrenheit,
|
||||
)
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_HVAC_MODE,
|
||||
CURRENT_HVAC_HEAT,
|
||||
@ -77,7 +77,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
async_add_entities([entity], True)
|
||||
|
||||
|
||||
class NuHeatThermostat(ClimateDevice):
|
||||
class NuHeatThermostat(ClimateEntity):
|
||||
"""Representation of a NuHeat Thermostat."""
|
||||
|
||||
def __init__(self, thermostat, temperature_unit):
|
||||
|
@ -5,7 +5,7 @@ from oemthermostat import Thermostat
|
||||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -59,7 +59,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities((ThermostatDevice(therm, name),), True)
|
||||
|
||||
|
||||
class ThermostatDevice(ClimateDevice):
|
||||
class ThermostatDevice(ClimateEntity):
|
||||
"""Interface class for the oemthermostat module."""
|
||||
|
||||
def __init__(self, thermostat, name):
|
||||
|
@ -3,7 +3,7 @@ import logging
|
||||
|
||||
from pyotgw import vars as gw_vars
|
||||
|
||||
from homeassistant.components.climate import ENTITY_ID_FORMAT, ClimateDevice
|
||||
from homeassistant.components.climate import ENTITY_ID_FORMAT, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_COOL,
|
||||
CURRENT_HVAC_HEAT,
|
||||
@ -51,7 +51,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
async_add_entities(ents)
|
||||
|
||||
|
||||
class OpenThermClimate(ClimateDevice):
|
||||
class OpenThermClimate(ClimateEntity):
|
||||
"""Representation of a climate device."""
|
||||
|
||||
def __init__(self, gw_dev, options):
|
||||
|
@ -5,7 +5,7 @@ import logging
|
||||
import haanna
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_COOL,
|
||||
CURRENT_HVAC_HEAT,
|
||||
@ -88,7 +88,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities(devices, True)
|
||||
|
||||
|
||||
class ThermostatDevice(ClimateDevice):
|
||||
class ThermostatDevice(ClimateEntity):
|
||||
"""Representation of the Plugwise thermostat."""
|
||||
|
||||
def __init__(self, api, name, min_temp, max_temp):
|
||||
|
@ -2,7 +2,7 @@
|
||||
import proliphix
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_COOL,
|
||||
HVAC_MODE_HEAT,
|
||||
@ -41,7 +41,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities([ProliphixThermostat(pdp)], True)
|
||||
|
||||
|
||||
class ProliphixThermostat(ClimateDevice):
|
||||
class ProliphixThermostat(ClimateEntity):
|
||||
"""Representation a Proliphix thermostat."""
|
||||
|
||||
def __init__(self, pdp):
|
||||
|
@ -4,7 +4,7 @@ import logging
|
||||
import radiotherm
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_COOL,
|
||||
CURRENT_HVAC_HEAT,
|
||||
@ -125,7 +125,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities(tstats, True)
|
||||
|
||||
|
||||
class RadioThermostat(ClimateDevice):
|
||||
class RadioThermostat(ClimateEntity):
|
||||
"""Representation of a Radio Thermostat."""
|
||||
|
||||
def __init__(self, device, hold_temp):
|
||||
|
@ -8,7 +8,7 @@ from homeassistant.components.climate import (
|
||||
PLATFORM_SCHEMA,
|
||||
SCAN_INTERVAL,
|
||||
TEMP_CELSIUS,
|
||||
ClimateDevice,
|
||||
ClimateEntity,
|
||||
)
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
@ -63,7 +63,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
)
|
||||
|
||||
|
||||
class SchluterThermostat(ClimateDevice):
|
||||
class SchluterThermostat(ClimateEntity):
|
||||
"""Representation of a Schluter thermostat."""
|
||||
|
||||
def __init__(self, coordinator, serial_number, api, session_id):
|
||||
|
@ -8,7 +8,7 @@ import async_timeout
|
||||
import pysensibo
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_COOL,
|
||||
HVAC_MODE_DRY,
|
||||
@ -135,7 +135,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
)
|
||||
|
||||
|
||||
class SensiboClimate(ClimateDevice):
|
||||
class SensiboClimate(ClimateEntity):
|
||||
"""Representation of a Sensibo device."""
|
||||
|
||||
def __init__(self, client, data, units):
|
||||
|
@ -5,7 +5,7 @@ from typing import Iterable, Optional, Sequence
|
||||
|
||||
from pysmartthings import Attribute, Capability
|
||||
|
||||
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN, ClimateDevice
|
||||
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_HVAC_MODE,
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
@ -144,7 +144,7 @@ def get_capabilities(capabilities: Sequence[str]) -> Optional[Sequence[str]]:
|
||||
return None
|
||||
|
||||
|
||||
class SmartThingsThermostat(SmartThingsEntity, ClimateDevice):
|
||||
class SmartThingsThermostat(SmartThingsEntity, ClimateEntity):
|
||||
"""Define a SmartThings climate entities."""
|
||||
|
||||
def __init__(self, device):
|
||||
@ -323,7 +323,7 @@ class SmartThingsThermostat(SmartThingsEntity, ClimateDevice):
|
||||
return UNIT_MAP.get(self._device.status.attributes[Attribute.temperature].unit)
|
||||
|
||||
|
||||
class SmartThingsAirConditioner(SmartThingsEntity, ClimateDevice):
|
||||
class SmartThingsAirConditioner(SmartThingsEntity, ClimateEntity):
|
||||
"""Define a SmartThings Air Conditioner."""
|
||||
|
||||
def __init__(self, device):
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import logging
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_COOL,
|
||||
HVAC_MODE_HEAT,
|
||||
@ -41,7 +41,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities(devices, True)
|
||||
|
||||
|
||||
class SpiderThermostat(ClimateDevice):
|
||||
class SpiderThermostat(ClimateEntity):
|
||||
"""Representation of a thermostat."""
|
||||
|
||||
def __init__(self, api, thermostat):
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Support for stiebel_eltron climate platform."""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_AUTO,
|
||||
HVAC_MODE_HEAT,
|
||||
@ -61,7 +61,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities([StiebelEltron(name, ste_data)], True)
|
||||
|
||||
|
||||
class StiebelEltron(ClimateDevice):
|
||||
class StiebelEltron(ClimateEntity):
|
||||
"""Representation of a STIEBEL ELTRON heat pump."""
|
||||
|
||||
def __init__(self, name, ste_data):
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Support for Tado thermostats."""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_OFF,
|
||||
FAN_AUTO,
|
||||
@ -163,7 +163,7 @@ def create_climate_entity(tado, name: str, zone_id: int, zone: dict):
|
||||
return entity
|
||||
|
||||
|
||||
class TadoClimate(TadoZoneEntity, ClimateDevice):
|
||||
class TadoClimate(TadoZoneEntity, ClimateEntity):
|
||||
"""Representation of a Tado climate entity."""
|
||||
|
||||
def __init__(
|
||||
|
@ -4,7 +4,7 @@ from typing import List, Optional
|
||||
|
||||
from teslajsonpy.exceptions import UnknownPresetMode
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_HEAT_COOL,
|
||||
HVAC_MODE_OFF,
|
||||
@ -37,7 +37,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
)
|
||||
|
||||
|
||||
class TeslaThermostat(TeslaDevice, ClimateDevice):
|
||||
class TeslaThermostat(TeslaDevice, ClimateEntity):
|
||||
"""Representation of a Tesla climate."""
|
||||
|
||||
def __init__(self, tesla_device, controller, config_entry):
|
||||
|
@ -6,7 +6,7 @@ import logging
|
||||
from pytfiac import Tfiac
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
FAN_AUTO,
|
||||
FAN_HIGH,
|
||||
@ -73,7 +73,7 @@ async def async_setup_platform(hass, config, async_add_devices, discovery_info=N
|
||||
async_add_devices([TfiacClimate(hass, tfiac_client)])
|
||||
|
||||
|
||||
class TfiacClimate(ClimateDevice):
|
||||
class TfiacClimate(ClimateEntity):
|
||||
"""TFIAC class."""
|
||||
|
||||
def __init__(self, hass, client):
|
||||
|
@ -3,7 +3,7 @@
|
||||
import logging
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -43,7 +43,7 @@ async def async_setup_entry(
|
||||
async_add_entities([ToonThermostatDevice(toon_client, toon_data)], True)
|
||||
|
||||
|
||||
class ToonThermostatDevice(ToonDisplayDeviceEntity, ClimateDevice):
|
||||
class ToonThermostatDevice(ToonDisplayDeviceEntity, ClimateEntity):
|
||||
"""Representation of a Toon climate device."""
|
||||
|
||||
def __init__(self, toon_client, toon_data: ToonData) -> None:
|
||||
|
@ -5,7 +5,7 @@ from typing import List
|
||||
from pytouchline import PyTouchline
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_HEAT,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
@ -32,7 +32,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities(devices, True)
|
||||
|
||||
|
||||
class Touchline(ClimateDevice):
|
||||
class Touchline(ClimateEntity):
|
||||
"""Representation of a Touchline device."""
|
||||
|
||||
def __init__(self, touchline_thermostat):
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""Support for the Tuya climate devices."""
|
||||
from homeassistant.components.climate import ENTITY_ID_FORMAT, ClimateDevice
|
||||
from homeassistant.components.climate import ENTITY_ID_FORMAT, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
FAN_HIGH,
|
||||
FAN_LOW,
|
||||
@ -48,11 +48,11 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
device = tuya.get_device_by_id(dev_id)
|
||||
if device is None:
|
||||
continue
|
||||
devices.append(TuyaClimateDevice(device))
|
||||
devices.append(TuyaClimateEntity(device))
|
||||
add_entities(devices)
|
||||
|
||||
|
||||
class TuyaClimateDevice(TuyaDevice, ClimateDevice):
|
||||
class TuyaClimateEntity(TuyaDevice, ClimateEntity):
|
||||
"""Tuya climate devices,include air conditioner,heater."""
|
||||
|
||||
def __init__(self, tuya):
|
||||
|
@ -3,7 +3,7 @@ import logging
|
||||
|
||||
from velbus.util import VelbusException
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_HEAT,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
@ -27,7 +27,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
class VelbusClimate(VelbusEntity, ClimateDevice):
|
||||
class VelbusClimate(VelbusEntity, ClimateEntity):
|
||||
"""Representation of a Velbus thermostat."""
|
||||
|
||||
@property
|
||||
|
@ -4,7 +4,7 @@ import logging
|
||||
from venstarcolortouch import VenstarColorTouch
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_HVAC_MODE,
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
@ -96,7 +96,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities([VenstarThermostat(client, humidifier)], True)
|
||||
|
||||
|
||||
class VenstarThermostat(ClimateDevice):
|
||||
class VenstarThermostat(ClimateEntity):
|
||||
"""Representation of a Venstar thermostat."""
|
||||
|
||||
def __init__(self, client, humidifier):
|
||||
|
@ -5,7 +5,7 @@ from typing import Callable, List
|
||||
from homeassistant.components.climate import (
|
||||
DOMAIN as PLATFORM_DOMAIN,
|
||||
ENTITY_ID_FORMAT,
|
||||
ClimateDevice,
|
||||
ClimateEntity,
|
||||
)
|
||||
from homeassistant.components.climate.const import (
|
||||
FAN_AUTO,
|
||||
@ -49,7 +49,7 @@ async def async_setup_entry(
|
||||
)
|
||||
|
||||
|
||||
class VeraThermostat(VeraDevice, ClimateDevice):
|
||||
class VeraThermostat(VeraDevice, ClimateEntity):
|
||||
"""Representation of a Vera Thermostat."""
|
||||
|
||||
def __init__(self, vera_device, controller):
|
||||
|
@ -3,7 +3,7 @@ import logging
|
||||
|
||||
import requests
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_IDLE,
|
||||
@ -97,7 +97,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
)
|
||||
|
||||
|
||||
class ViCareClimate(ClimateDevice):
|
||||
class ViCareClimate(ClimateEntity):
|
||||
"""Representation of the ViCare heating climate device."""
|
||||
|
||||
def __init__(self, name, api, heating_type):
|
||||
|
@ -3,7 +3,7 @@ import logging
|
||||
|
||||
import pywink
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
@ -80,7 +80,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities([WinkAC(climate, hass)])
|
||||
|
||||
|
||||
class WinkThermostat(WinkDevice, ClimateDevice):
|
||||
class WinkThermostat(WinkDevice, ClimateEntity):
|
||||
"""Representation of a Wink thermostat."""
|
||||
|
||||
@property
|
||||
@ -381,7 +381,7 @@ class WinkThermostat(WinkDevice, ClimateDevice):
|
||||
return return_value
|
||||
|
||||
|
||||
class WinkAC(WinkDevice, ClimateDevice):
|
||||
class WinkAC(WinkDevice, ClimateEntity):
|
||||
"""Representation of a Wink air conditioner."""
|
||||
|
||||
@property
|
||||
|
@ -3,7 +3,7 @@ import logging
|
||||
|
||||
from xs1_api_client.api_constants import ActuatorType
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_HEAT,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
@ -42,7 +42,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities(thermostat_entities)
|
||||
|
||||
|
||||
class XS1ThermostatEntity(XS1DeviceEntity, ClimateDevice):
|
||||
class XS1ThermostatEntity(XS1DeviceEntity, ClimateEntity):
|
||||
"""Representation of a XS1 thermostat."""
|
||||
|
||||
def __init__(self, device, sensor):
|
||||
|
@ -5,7 +5,7 @@ import voluptuous as vol
|
||||
from zhong_hong_hvac.hub import ZhongHongGateway
|
||||
from zhong_hong_hvac.hvac import HVAC as ZhongHongHVAC
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_HVAC_MODE,
|
||||
HVAC_MODE_COOL,
|
||||
@ -113,7 +113,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, stop_listen)
|
||||
|
||||
|
||||
class ZhongHongClimate(ClimateDevice):
|
||||
class ZhongHongClimate(ClimateEntity):
|
||||
"""Representation of a ZhongHong controller support HVAC."""
|
||||
|
||||
def __init__(self, hub, addr_out, addr_in):
|
||||
|
@ -3,7 +3,7 @@
|
||||
import logging
|
||||
from typing import Optional, Tuple
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
@ -149,7 +149,7 @@ def get_device(hass, values, **kwargs):
|
||||
return None
|
||||
|
||||
|
||||
class ZWaveClimateBase(ZWaveDeviceEntity, ClimateDevice):
|
||||
class ZWaveClimateBase(ZWaveDeviceEntity, ClimateEntity):
|
||||
"""Representation of a Z-Wave Climate device."""
|
||||
|
||||
def __init__(self, values, temp_unit):
|
||||
|
@ -10,6 +10,7 @@ from homeassistant.components.climate import (
|
||||
HVAC_MODE_OFF,
|
||||
SET_TEMPERATURE_SCHEMA,
|
||||
ClimateDevice,
|
||||
ClimateEntity,
|
||||
)
|
||||
|
||||
from tests.common import async_mock_service
|
||||
@ -45,7 +46,7 @@ async def test_set_temp_schema(hass, caplog):
|
||||
assert calls[-1].data == data
|
||||
|
||||
|
||||
class MockClimateDevice(ClimateDevice):
|
||||
class MockClimateEntity(ClimateEntity):
|
||||
"""Mock Climate device to use in tests."""
|
||||
|
||||
@property
|
||||
@ -67,7 +68,7 @@ class MockClimateDevice(ClimateDevice):
|
||||
|
||||
async def test_sync_turn_on(hass):
|
||||
"""Test if async turn_on calls sync turn_on."""
|
||||
climate = MockClimateDevice()
|
||||
climate = MockClimateEntity()
|
||||
climate.hass = hass
|
||||
|
||||
climate.turn_on = MagicMock()
|
||||
@ -78,10 +79,24 @@ async def test_sync_turn_on(hass):
|
||||
|
||||
async def test_sync_turn_off(hass):
|
||||
"""Test if async turn_off calls sync turn_off."""
|
||||
climate = MockClimateDevice()
|
||||
climate = MockClimateEntity()
|
||||
climate.hass = hass
|
||||
|
||||
climate.turn_off = MagicMock()
|
||||
await climate.async_turn_off()
|
||||
|
||||
assert climate.turn_off.called
|
||||
|
||||
|
||||
def test_deprecated_base_class(caplog):
|
||||
"""Test deprecated base class."""
|
||||
|
||||
class CustomClimate(ClimateDevice):
|
||||
def hvac_mode(self):
|
||||
pass
|
||||
|
||||
def hvac_modes(self):
|
||||
pass
|
||||
|
||||
CustomClimate()
|
||||
assert "ClimateDevice is deprecated, modify CustomClimate" in caplog.text
|
||||
|
Loading…
x
Reference in New Issue
Block a user