diff --git a/mqtt_as/mqtt_as.py b/mqtt_as/mqtt_as.py index 849c3fd..6a2b6e6 100644 --- a/mqtt_as/mqtt_as.py +++ b/mqtt_as/mqtt_as.py @@ -44,6 +44,7 @@ async def eliza(*_): # e.g. via set_wifi_handler(coro): see test program config = { 'client_id' : hexlify(unique_id()), + 'hostname' : None, 'server' : None, 'port' : 0, 'user' : '', @@ -132,6 +133,8 @@ def __init__(self, config): self._sock = None self._sta_if = network.WLAN(network.STA_IF) self._sta_if.active(True) + if self.hostname: + self._sta_if.config(dhcp_hostname=self.hostname) self.pid = 0 self.rcv_pid = 0