Skip to content

Commit

Permalink
Merge pull request #13 from astrandb/Comatibility2023.4
Browse files Browse the repository at this point in the history
Fix for HA2023.4
  • Loading branch information
astrandb committed Apr 13, 2023
2 parents d455f44 + db132f1 commit fd32e82
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"image": "ghcr.io/ludeeus/devcontainer/integration:stable",
"name": "Teracom integration",
"context": "..",
"appPort": [
"9128:8123"
],
Expand Down Expand Up @@ -51,4 +52,4 @@
// "source=${localEnv:HOME}/teracom_config,target=${containerWorkspaceFolder}/config,type=bind"
"source=${localEnv:HOME}/teracom_config,target=/config,type=bind"
]
}
}
5 changes: 4 additions & 1 deletion custom_components/teracom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ async def poll_update(event_time):
# verify_ssl = DEFAULT_VERIFY_SSL
headers = {}
endpoint = f"http://{config.get('host')}/status.xml"
encoding = ""

try:
rest = RestData(hass, method, endpoint, "", auth, headers, None, payload, False)
rest = RestData(
hass, method, endpoint, encoding, auth, headers, None, payload, False
)
await rest.async_update()
except Exception as err:
raise ConfigEntryNotReady from err
Expand Down
3 changes: 2 additions & 1 deletion custom_components/teracom/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ async def authenticate(self, hass, username, password) -> bool:
verify_ssl = False
headers = {}
endpoint = f"http://{self.host}/status.xml"
encoding = ""

rest = RestData(
hass, method, endpoint, auth, headers, None, payload, verify_ssl
hass, method, endpoint, encoding, auth, headers, None, payload, verify_ssl
)
await rest.async_update()

Expand Down
2 changes: 1 addition & 1 deletion custom_components/teracom/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
DOMAIN = "teracom"
SIGNAL_UPDATE_TERACOM = "signal_update_teracom"
SUPPORTED_MODELS = {"TCW122B-CM", "TCW181B-CM"}
VERSION = "0.1.8"
VERSION = "0.1.9"
4 changes: 2 additions & 2 deletions custom_components/teracom/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async def set_relay(self, relay_no, to_state):
endpoint = f"http://{self._host}/status.xml?r{relay_no}={to_state}"

rest = RestData(
self._hass, method, endpoint, auth, headers, None, payload, verify_ssl
self._hass, method, endpoint, "", auth, headers, None, payload, verify_ssl
)
await rest.async_update()

Expand All @@ -87,7 +87,7 @@ async def get_data(self):
endpoint = f"http://{self._host}/status.xml"

rest = RestData(
self._hass, method, endpoint, auth, headers, None, payload, verify_ssl
self._hass, method, endpoint, "", auth, headers, None, payload, verify_ssl
)
await rest.async_update()

Expand Down
18 changes: 10 additions & 8 deletions custom_components/teracom/manifest.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"domain": "teracom",
"name": "Teracom TCW",
"after_dependencies": [
"rest"
],
"codeowners": [
"@astrandb"
],
"config_flow": true,
"documentation": "https://github.com/astrandb/teracom/README.md",
"homekit": {},
"iot_class": "local_polling",
"issue_tracker": "https://github.com/astrandb/teracom_hass/issues",
"requirements": [],
"version": "0.1.8",
"ssdp": [],
"zeroconf": [],
"homekit": {},
"after_dependencies": ["rest"],
"codeowners": [
"@astrandb"
],
"iot_class": "local_polling"
"version": "0.1.9",
"zeroconf": []
}
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[bumpversion]
current_version = 0.1.8
current_version = 0.1.9

[flake8]
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
doctests = True
max-line-length = 88
ignore =
ignore =
E501,
W503,
E203,
Expand Down

0 comments on commit fd32e82

Please sign in to comment.