Skip to content

Commit

Permalink
Added setting temp_nofeedback (#35)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
aceindy authored Jun 19, 2023
1 parent 2c83982 commit bfbb085
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions custom_components/duepi_evo/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
port: 23
scan_interval: 10
auto_reset: True
temp_nofeedback: 16
"""
import asyncio
import async_timeout
Expand Down Expand Up @@ -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(
{
Expand All @@ -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,
}
)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion custom_components/duepi_evo/manifest.json
Original file line number Diff line number Diff line change
@@ -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": [],
Expand Down

0 comments on commit bfbb085

Please sign in to comment.