mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
ESPHome: Add additional field for current temperature precision (#88464)
This commit is contained in:
parent
ba2e80f741
commit
6da524b378
@ -142,8 +142,12 @@ class EsphomeClimateEntity(EsphomeEntity[ClimateInfo, ClimateState], ClimateEnti
|
|||||||
def precision(self) -> float:
|
def precision(self) -> float:
|
||||||
"""Return the precision of the climate device."""
|
"""Return the precision of the climate device."""
|
||||||
precicions = [PRECISION_WHOLE, PRECISION_HALVES, PRECISION_TENTHS]
|
precicions = [PRECISION_WHOLE, PRECISION_HALVES, PRECISION_TENTHS]
|
||||||
|
if self._static_info.visual_current_temperature_step != 0:
|
||||||
|
step = self._static_info.visual_current_temperature_step
|
||||||
|
else:
|
||||||
|
step = self._static_info.visual_target_temperature_step
|
||||||
for prec in precicions:
|
for prec in precicions:
|
||||||
if self._static_info.visual_temperature_step >= prec:
|
if step >= prec:
|
||||||
return prec
|
return prec
|
||||||
# Fall back to highest precision, tenths
|
# Fall back to highest precision, tenths
|
||||||
return PRECISION_TENTHS
|
return PRECISION_TENTHS
|
||||||
@ -184,7 +188,7 @@ class EsphomeClimateEntity(EsphomeEntity[ClimateInfo, ClimateState], ClimateEnti
|
|||||||
def target_temperature_step(self) -> float:
|
def target_temperature_step(self) -> float:
|
||||||
"""Return the supported step of target temperature."""
|
"""Return the supported step of target temperature."""
|
||||||
# Round to one digit because of floating point math
|
# Round to one digit because of floating point math
|
||||||
return round(self._static_info.visual_temperature_step, 1)
|
return round(self._static_info.visual_target_temperature_step, 1)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self) -> float:
|
def min_temp(self) -> float:
|
||||||
|
@ -14,6 +14,6 @@
|
|||||||
"integration_type": "device",
|
"integration_type": "device",
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"loggers": ["aioesphomeapi", "noiseprotocol"],
|
"loggers": ["aioesphomeapi", "noiseprotocol"],
|
||||||
"requirements": ["aioesphomeapi==13.3.1", "esphome-dashboard-api==1.2.3"],
|
"requirements": ["aioesphomeapi==13.4.0", "esphome-dashboard-api==1.2.3"],
|
||||||
"zeroconf": ["_esphomelib._tcp.local."]
|
"zeroconf": ["_esphomelib._tcp.local."]
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ aioecowitt==2023.01.0
|
|||||||
aioemonitor==1.0.5
|
aioemonitor==1.0.5
|
||||||
|
|
||||||
# homeassistant.components.esphome
|
# homeassistant.components.esphome
|
||||||
aioesphomeapi==13.3.1
|
aioesphomeapi==13.4.0
|
||||||
|
|
||||||
# homeassistant.components.flo
|
# homeassistant.components.flo
|
||||||
aioflo==2021.11.0
|
aioflo==2021.11.0
|
||||||
|
@ -143,7 +143,7 @@ aioecowitt==2023.01.0
|
|||||||
aioemonitor==1.0.5
|
aioemonitor==1.0.5
|
||||||
|
|
||||||
# homeassistant.components.esphome
|
# homeassistant.components.esphome
|
||||||
aioesphomeapi==13.3.1
|
aioesphomeapi==13.4.0
|
||||||
|
|
||||||
# homeassistant.components.flo
|
# homeassistant.components.flo
|
||||||
aioflo==2021.11.0
|
aioflo==2021.11.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user