Revert "Set Fahrenheit reporting precision to tenths for Homekit Controller climate entities (#50415)" (#51698)

This commit is contained in:
Jc2k 2021-06-10 15:41:42 +01:00 committed by GitHub
parent 17cf0cef0f
commit d75c97cbf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 19 deletions

View file

@ -36,7 +36,7 @@ from homeassistant.components.climate.const import (
SWING_OFF,
SWING_VERTICAL,
)
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_TENTHS, TEMP_CELSIUS
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS
from homeassistant.core import callback
from . import KNOWN_DEVICES, HomeKitEntity
@ -323,11 +323,6 @@ class HomeKitHeaterCoolerEntity(HomeKitEntity, ClimateEntity):
"""Return the unit of measurement."""
return TEMP_CELSIUS
@property
def precision(self):
"""Return the precision of the system."""
return PRECISION_TENTHS
class HomeKitClimateEntity(HomeKitEntity, ClimateEntity):
"""Representation of a Homekit climate device."""
@ -541,11 +536,6 @@ class HomeKitClimateEntity(HomeKitEntity, ClimateEntity):
"""Return the unit of measurement."""
return TEMP_CELSIUS
@property
def precision(self):
"""Return the precision of the system."""
return PRECISION_TENTHS
ENTITY_TYPES = {
ServicesTypes.HEATER_COOLER: HomeKitHeaterCoolerEntity,

View file

@ -1,6 +1,4 @@
"""Basic checks for HomeKitclimate."""
from unittest.mock import patch
from aiohomekit.model.characteristics import (
ActivationStateValues,
CharacteristicsTypes,
@ -21,7 +19,6 @@ from homeassistant.components.climate.const import (
SERVICE_SET_SWING_MODE,
SERVICE_SET_TEMPERATURE,
)
from homeassistant.const import TEMP_FAHRENHEIT
from tests.components.homekit_controller.common import setup_test_component
@ -448,11 +445,6 @@ async def test_climate_read_thermostat_state(hass, utcnow):
state = await helper.poll_and_get_state()
assert state.state == HVAC_MODE_HEAT_COOL
# Ensure converted Fahrenheit precision is reported in tenths
with patch.object(hass.config.units, "temperature_unit", TEMP_FAHRENHEIT):
state = await helper.poll_and_get_state()
assert state.attributes["current_temperature"] == 69.8
async def test_hvac_mode_vs_hvac_action(hass, utcnow):
"""Check that we haven't conflated hvac_mode and hvac_action."""