Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions TheengsGateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import sys
import uuid
import socket
from pathlib import Path

from .ble_gateway import run
Expand Down Expand Up @@ -58,6 +59,9 @@ def main() -> None:
if not configuration["host"]:
sys.exit("MQTT host is not specified")

if not configuration["discovery_device_name"]:
configuration["discovery_device_name"] = socket.gethostname() + "-TheengsGateway"

# Make sure discovery_filter is a list, and convert to list
# if it is actually a string (Docker and HA Add-in)
if isinstance(configuration["discovery_filter"], str):
Expand Down
2 changes: 1 addition & 1 deletion TheengsGateway/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"discovery": 1,
"general_presence": 0,
"discovery_topic": "homeassistant",
"discovery_device_name": "TheengsGateway",
"discovery_device_name": "",
"discovery_filter": [
"IBEACON",
],
Expand Down