Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
bj00rn committed Dec 4, 2022
1 parent 7bd08ee commit 5e98b81
Show file tree
Hide file tree
Showing 10 changed files with 234 additions and 157 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_config:
logger:
default: info
logs:
custom_components.saleryd_ftx: info
custom_components.saleryd_ftx: debug

# If you need to debug uncomment the line below (doc: https://www.home-assistant.io/integrations/debugpy/)
debugpy:
2 changes: 1 addition & 1 deletion custom_components/saleryd_ftx/const.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Constants for integration_blueprint."""
# Base component constants
NAME = "Saleryd FTX integration"
NAME = "Saleryd HRV integration"
MANUFACTURER = "Saleryd"
DOMAIN = "saleryd_ftx"
DOMAIN_DATA = f"{DOMAIN}_data"
Expand Down
4 changes: 2 additions & 2 deletions custom_components/saleryd_ftx/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"config": {
"step": {
"user": {
"title": "Saleryd Loke FTX integration",
"description": "Provide websocket url to FTX fan",
"title": "Saleryd Loke HRV integration",
"description": "Provide websocket url to HRV fan",
"websocket": "Websocket URL",
"data": {
"websocket": "Websocket URL"
Expand Down
15 changes: 9 additions & 6 deletions custom_components/saleryd_ftx/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class Gateway:
"""Gateway to manage communication with FTX"""
"""Gateway to manage communication with HRV"""

def __init__(self, session, url, port):
self._url = url
Expand Down Expand Up @@ -38,13 +38,16 @@ def _parse_message(self, msg):

value = msg[1::].split(":")[1].strip()
if msg[1] != "*":
# messages beginning with * are arrays
# messages beginning with * are arrays of integers
# [value, min, max] or [value, min, max, time_left]
value = [v.strip() for v in value.split("+")]
value = [
int(v.strip()) if v.strip().isnumeric() else v.strip()
for v in value.split("+")
]
key = msg[1::].split(":")[0]
parsed = (key, value)
except Exception as exc:
_LOGGER.warning("Failed to parse message %s", msg, exc_info=1)
_LOGGER.warning("Failed to parse message %s", msg, exc_info=True)
return parsed

@property
Expand All @@ -62,5 +65,5 @@ def data(self):
return parsed_data

async def send_command(self, key, value):
"""Send command to FTX"""
return await self._ws.send_message(f"#{key}:{value}\r")
"""Send command to HRV"""
await self._ws.send_message(f"#{key}:{value}\r")
2 changes: 1 addition & 1 deletion custom_components/saleryd_ftx/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "saleryd_ftx",
"name": "Saleryd FTX",
"name": "Saleryd HRV",
"documentation": "https://github.com/bj00rn/ha-saleryd-ftx",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/bj00rn/ha-saleryd-ftx",
Expand Down
Loading

0 comments on commit 5e98b81

Please sign in to comment.