mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
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
@ -11,6 +11,7 @@ from nexia.const import (
|
|||||||
SYSTEM_STATUS_IDLE,
|
SYSTEM_STATUS_IDLE,
|
||||||
UNIT_FAHRENHEIT,
|
UNIT_FAHRENHEIT,
|
||||||
)
|
)
|
||||||
|
from nexia.util import find_humidity_setpoint
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.climate import ClimateEntity
|
from homeassistant.components.climate import ClimateEntity
|
||||||
@ -58,6 +59,8 @@ from .coordinator import NexiaDataUpdateCoordinator
|
|||||||
from .entity import NexiaThermostatZoneEntity
|
from .entity import NexiaThermostatZoneEntity
|
||||||
from .util import percent_conv
|
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_AIRCLEANER_MODE = "set_aircleaner_mode"
|
||||||
SERVICE_SET_HUMIDIFY_SETPOINT = "set_humidify_setpoint"
|
SERVICE_SET_HUMIDIFY_SETPOINT = "set_humidify_setpoint"
|
||||||
SERVICE_SET_HVAC_RUN_MODE = "set_hvac_run_mode"
|
SERVICE_SET_HVAC_RUN_MODE = "set_hvac_run_mode"
|
||||||
@ -231,9 +234,9 @@ class NexiaZone(NexiaThermostatZoneEntity, ClimateEntity):
|
|||||||
def set_humidity(self, humidity):
|
def set_humidity(self, humidity):
|
||||||
"""Dehumidify target."""
|
"""Dehumidify target."""
|
||||||
if self._thermostat.has_dehumidify_support():
|
if self._thermostat.has_dehumidify_support():
|
||||||
self._thermostat.set_dehumidify_setpoint(humidity / 100.0)
|
self.set_dehumidify_setpoint(humidity)
|
||||||
else:
|
else:
|
||||||
self._thermostat.set_humidify_setpoint(humidity / 100.0)
|
self.set_humidify_setpoint(humidity)
|
||||||
self._signal_thermostat_update()
|
self._signal_thermostat_update()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -453,7 +456,22 @@ class NexiaZone(NexiaThermostatZoneEntity, ClimateEntity):
|
|||||||
|
|
||||||
def set_humidify_setpoint(self, humidity):
|
def set_humidify_setpoint(self, humidity):
|
||||||
"""Set the humidify setpoint."""
|
"""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()
|
self._signal_thermostat_update()
|
||||||
|
|
||||||
def _signal_thermostat_update(self):
|
def _signal_thermostat_update(self):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"domain": "nexia",
|
"domain": "nexia",
|
||||||
"name": "Nexia/American Standard/Trane",
|
"name": "Nexia/American Standard/Trane",
|
||||||
"requirements": ["nexia==0.9.11"],
|
"requirements": ["nexia==0.9.12"],
|
||||||
"codeowners": ["@bdraco"],
|
"codeowners": ["@bdraco"],
|
||||||
"documentation": "https://www.home-assistant.io/integrations/nexia",
|
"documentation": "https://www.home-assistant.io/integrations/nexia",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
|
@ -1074,7 +1074,7 @@ nettigo-air-monitor==1.2.1
|
|||||||
neurio==0.3.1
|
neurio==0.3.1
|
||||||
|
|
||||||
# homeassistant.components.nexia
|
# homeassistant.components.nexia
|
||||||
nexia==0.9.11
|
nexia==0.9.12
|
||||||
|
|
||||||
# homeassistant.components.nextcloud
|
# homeassistant.components.nextcloud
|
||||||
nextcloudmonitor==1.1.0
|
nextcloudmonitor==1.1.0
|
||||||
|
@ -663,7 +663,7 @@ netmap==0.7.0.2
|
|||||||
nettigo-air-monitor==1.2.1
|
nettigo-air-monitor==1.2.1
|
||||||
|
|
||||||
# homeassistant.components.nexia
|
# homeassistant.components.nexia
|
||||||
nexia==0.9.11
|
nexia==0.9.12
|
||||||
|
|
||||||
# homeassistant.components.nfandroidtv
|
# homeassistant.components.nfandroidtv
|
||||||
notifications-android-tv==0.1.3
|
notifications-android-tv==0.1.3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user