Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addressed warnings 'SUPPORT_TARGET_TEMPERATURE was used from tuya_sma… #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions custom_components/tuya_smart_ir_ac/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import homeassistant.helpers.config_validation as cv
from homeassistant.components.climate.const import (
HVACMode,
SUPPORT_TARGET_TEMPERATURE,
SUPPORT_FAN_MODE,
ClimateEntityFeature,
)
from homeassistant.const import UnitOfTemperature, STATE_UNKNOWN
from homeassistant.components.climate import ClimateEntity
Expand Down Expand Up @@ -60,6 +59,8 @@ def setup_platform(


class TuyaThermostat(ClimateEntity):
_enable_turn_on_off_backwards_compatibility = False

def __init__(self, climate, hass):
_LOGGER.info(pformat(climate))
self._api = TuyaAPI(
Expand All @@ -71,22 +72,28 @@ def __init__(self, climate, hass):
)
self._sensor_name = climate[SENSOR]
self._name = climate[NAME]
self._unique_id = climate[AC_ID]

@property
def name(self):
return self._name

@property
def unique_id(self):
return "tuya_hack_01"
return self._unique_id

@property
def temperature_unit(self):
return UnitOfTemperature.CELSIUS

@property
def supported_features(self):
return SUPPORT_TARGET_TEMPERATURE | SUPPORT_FAN_MODE
return (
ClimateEntityFeature.TARGET_TEMPERATURE
| ClimateEntityFeature.FAN_MODE
| ClimateEntityFeature.TURN_ON
| ClimateEntityFeature.TURN_OFF
)

@property
def min_temp(self):
Expand Down