Skip to content

Commit

Permalink
Removed leftovers of persistence option
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdelprete committed Feb 19, 2024
1 parent e0e541e commit 9f61e50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions custom_components/4noks_elios4you/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class E4Utelnet(Telnet):

if sys.version > "3":

def read_until(self, expected, timeout=None) -> str:
def read_until(self, separator: str, timeout: int) -> str:
"""Override telnetlib.telnet read_until."""
expected = bytes(expected, encoding="utf-8")
received = super().read_until(expected, timeout)
separator = bytes(separator, encoding="utf-8")
received = super().read_until(separator, timeout)
return str(received, encoding="utf-8")

def read_all(self) -> str:
Expand Down Expand Up @@ -293,7 +293,7 @@ def telnet_get_data(self, cmd: str):
f"telnet_get_data (WARNING): read_until loop started (conn: {self.E4Uclient.is_open()}) at {datetime.now()}"
)
# read stream up to the "ready..."" string (end of response)
response = self.E4Uclient.read_until(separator, timeout=3)
response = self.E4Uclient.read_until(separator, self._timeout)
_LOGGER.debug(
f"telnet_get_data (WARNING): read_until loop ended (conn: {self.E4Uclient.is_open()}) at {datetime.now()}"
)
Expand Down
5 changes: 1 addition & 4 deletions custom_components/4noks_elios4you/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from .const import (
CONF_HOST,
CONF_NAME,
CONF_PERSISTENCE,
CONF_PORT,
CONF_SCAN_INTERVAL,
DEFAULT_SCAN_INTERVAL,
Expand Down Expand Up @@ -63,16 +62,14 @@ def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
config_entry.data.get(CONF_NAME),
config_entry.data.get(CONF_HOST),
config_entry.data.get(CONF_PORT),
config_entry.data.get(CONF_PERSISTENCE),
)

_LOGGER.debug("Coordinator Config Data: %s", config_entry.data)
_LOGGER.debug(
"Coordinator API init: Host: %s Port: %s ID: %s ScanInterval: %s Persistent Conn.: %s",
"Coordinator API init: Host: %s Port: %s ID: %s ScanInterval: %s",
config_entry.data.get(CONF_HOST),
config_entry.data.get(CONF_PORT),
self.scan_interval,
config_entry.data.get(CONF_PERSISTENCE),
)

async def async_update_data(self):
Expand Down

0 comments on commit 9f61e50

Please sign in to comment.