From bfbb085933a409f62da8a78ab5f5f48d3ba9efa9 Mon Sep 17 00:00:00 2001 From: aceindy Date: Mon, 19 Jun 2023 12:23:58 +0200 Subject: [PATCH] Added setting temp_nofeedback (#35) * Update manifest.json * Update climate.py Added setting temp_nofeedback Use this temperature when device doesn't support feedback (instead of using current temperature) * Update climate.py --- custom_components/duepi_evo/climate.py | 9 +++++++-- custom_components/duepi_evo/manifest.json | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/custom_components/duepi_evo/climate.py b/custom_components/duepi_evo/climate.py index 7b15cf7..7d80d45 100644 --- a/custom_components/duepi_evo/climate.py +++ b/custom_components/duepi_evo/climate.py @@ -9,6 +9,7 @@ port: 23 scan_interval: 10 auto_reset: True + temp_nofeedback: 16 """ import asyncio import async_timeout @@ -66,10 +67,12 @@ DEFAULT_PORT = 23 DEFAULT_MIN_TEMP = 16.0 DEFAULT_MAX_TEMP = 30.0 +DEFAULT_NOFEEDBACK = 16.0 DEFAULT_AUTO_RESET = False CONF_MIN_TEMP = "min_temp" CONF_MAX_TEMP = "max_temp" CONF_AUTO_RESET = "auto_reset" +CONF_NOFEEDBACK = "temp_nofeedback" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { @@ -79,6 +82,7 @@ vol.Optional(CONF_MIN_TEMP, default=DEFAULT_MIN_TEMP): config_validation.positive_float, vol.Optional(CONF_MAX_TEMP, default=DEFAULT_MAX_TEMP): config_validation.positive_float, vol.Optional(CONF_AUTO_RESET, default=DEFAULT_AUTO_RESET): config_validation.boolean, + vol.Optional(CONF_NOFEEDBACK, default=DEFAULT_NOFEEDBACK): config_validation.positive_float, } ) @@ -133,6 +137,7 @@ def __init__(self, session, config) -> None: self._min_temp = config.get(CONF_MIN_TEMP) self._max_temp = config.get(CONF_MAX_TEMP) self._auto_reset = config.get(CONF_AUTO_RESET) + self._no_feedback = config.get(CONF_NOFEEDBACK) self._current_temperature = None self._target_temperature = None self._heating = False @@ -195,8 +200,8 @@ def target_temperature(self) -> Optional[float]: """Return the temperature we try to reach. Use environment temperature if set to None (bug)""" if self._target_temperature is None: - self._target_temperature = int(self._current_temperature) - _LOGGER.debug("%s Setpoint retrieval not supported by this stove, using _current_temperature %s", self._name, str(self._target_temperature)) + self._target_temperature = int(self._no_feedback) + _LOGGER.debug("%s Setpoint retrieval not supported by this stove, using temp_nofeedback %s", self._name, str(self._target_temperature)) return self._target_temperature @property diff --git a/custom_components/duepi_evo/manifest.json b/custom_components/duepi_evo/manifest.json index b2f0fa8..a9f6e80 100644 --- a/custom_components/duepi_evo/manifest.json +++ b/custom_components/duepi_evo/manifest.json @@ -1,7 +1,7 @@ { "domain": "duepi_evo", "name": "Duepi Evo", - "version":"2023.04.17", + "version":"2023.06.19", "documentation": "https://github.com/aceindy/Duepi_EVO", "issue_tracker": "https://github.com/aceindy/Duepi_EVO/issues", "dependencies": [],