Avoid setting nexia humidity to the same value since it causes the api to fail (#61843)
This commit is contained in:
parent
03477e0ae6
commit
7764c957ba
4 changed files with 24 additions and 6 deletions
|
@ -11,6 +11,7 @@ from nexia.const import (
|
|||
SYSTEM_STATUS_IDLE,
|
||||
UNIT_FAHRENHEIT,
|
||||
)
|
||||
from nexia.util import find_humidity_setpoint
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
|
@ -58,6 +59,8 @@ from .coordinator import NexiaDataUpdateCoordinator
|
|||
from .entity import NexiaThermostatZoneEntity
|
||||
from .util import percent_conv
|
||||
|
||||
PARALLEL_UPDATES = 1 # keep data in sync with only one connection at a time
|
||||
|
||||
SERVICE_SET_AIRCLEANER_MODE = "set_aircleaner_mode"
|
||||
SERVICE_SET_HUMIDIFY_SETPOINT = "set_humidify_setpoint"
|
||||
SERVICE_SET_HVAC_RUN_MODE = "set_hvac_run_mode"
|
||||
|
@ -231,9 +234,9 @@ class NexiaZone(NexiaThermostatZoneEntity, ClimateEntity):
|
|||
def set_humidity(self, humidity):
|
||||
"""Dehumidify target."""
|
||||
if self._thermostat.has_dehumidify_support():
|
||||
self._thermostat.set_dehumidify_setpoint(humidity / 100.0)
|
||||
self.set_dehumidify_setpoint(humidity)
|
||||
else:
|
||||
self._thermostat.set_humidify_setpoint(humidity / 100.0)
|
||||
self.set_humidify_setpoint(humidity)
|
||||
self._signal_thermostat_update()
|
||||
|
||||
@property
|
||||
|
@ -453,7 +456,22 @@ class NexiaZone(NexiaThermostatZoneEntity, ClimateEntity):
|
|||
|
||||
def set_humidify_setpoint(self, humidity):
|
||||
"""Set the humidify setpoint."""
|
||||
self._thermostat.set_humidify_setpoint(humidity / 100.0)
|
||||
target_humidity = find_humidity_setpoint(humidity / 100.0)
|
||||
if self._thermostat.get_humidify_setpoint() == target_humidity:
|
||||
# Trying to set the humidify setpoint to the
|
||||
# same value will cause the api to timeout
|
||||
return
|
||||
self._thermostat.set_humidify_setpoint(target_humidity)
|
||||
self._signal_thermostat_update()
|
||||
|
||||
def set_dehumidify_setpoint(self, humidity):
|
||||
"""Set the dehumidify setpoint."""
|
||||
target_humidity = find_humidity_setpoint(humidity / 100.0)
|
||||
if self._thermostat.get_dehumidify_setpoint() == target_humidity:
|
||||
# Trying to set the dehumidify setpoint to the
|
||||
# same value will cause the api to timeout
|
||||
return
|
||||
self._thermostat.set_dehumidify_setpoint(target_humidity)
|
||||
self._signal_thermostat_update()
|
||||
|
||||
def _signal_thermostat_update(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"domain": "nexia",
|
||||
"name": "Nexia/American Standard/Trane",
|
||||
"requirements": ["nexia==0.9.11"],
|
||||
"requirements": ["nexia==0.9.12"],
|
||||
"codeowners": ["@bdraco"],
|
||||
"documentation": "https://www.home-assistant.io/integrations/nexia",
|
||||
"config_flow": true,
|
||||
|
|
|
@ -1074,7 +1074,7 @@ nettigo-air-monitor==1.2.1
|
|||
neurio==0.3.1
|
||||
|
||||
# homeassistant.components.nexia
|
||||
nexia==0.9.11
|
||||
nexia==0.9.12
|
||||
|
||||
# homeassistant.components.nextcloud
|
||||
nextcloudmonitor==1.1.0
|
||||
|
|
|
@ -663,7 +663,7 @@ netmap==0.7.0.2
|
|||
nettigo-air-monitor==1.2.1
|
||||
|
||||
# homeassistant.components.nexia
|
||||
nexia==0.9.11
|
||||
nexia==0.9.12
|
||||
|
||||
# homeassistant.components.nfandroidtv
|
||||
notifications-android-tv==0.1.3
|
||||
|
|
Loading…
Add table
Reference in a new issue