diff --git a/TheengsGateway/__init__.py b/TheengsGateway/__init__.py index 9d806653..6b09be68 100644 --- a/TheengsGateway/__init__.py +++ b/TheengsGateway/__init__.py @@ -20,6 +20,7 @@ import sys import uuid +import socket from pathlib import Path from .ble_gateway import run @@ -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): diff --git a/TheengsGateway/config.py b/TheengsGateway/config.py index b8fc97c0..dd6f5bd8 100644 --- a/TheengsGateway/config.py +++ b/TheengsGateway/config.py @@ -32,7 +32,7 @@ "discovery": 1, "general_presence": 0, "discovery_topic": "homeassistant", - "discovery_device_name": "TheengsGateway", + "discovery_device_name": "", "discovery_filter": [ "IBEACON", ],