mirror of
https://github.com/esphome/esphome.git
synced 2024-11-08 09:40:53 +01:00
Fix dashboard logs when api is disabled and using MQTT (#5992)
This commit is contained in:
parent
45f9f3d972
commit
9202a30dc7
@ -301,11 +301,16 @@ class EsphomePortCommandWebSocket(EsphomeCommandWebSocket):
|
|||||||
config_file = settings.rel_path(configuration)
|
config_file = settings.rel_path(configuration)
|
||||||
port = json_message["port"]
|
port = json_message["port"]
|
||||||
if (
|
if (
|
||||||
port == "OTA"
|
port == "OTA" # pylint: disable=too-many-boolean-expressions
|
||||||
and (mdns := dashboard.mdns_status)
|
and (mdns := dashboard.mdns_status)
|
||||||
and (entry := entries.get(config_file))
|
and (entry := entries.get(config_file))
|
||||||
|
and entry.loaded_integrations
|
||||||
|
and "api" in entry.loaded_integrations
|
||||||
and (address := await mdns.async_resolve_host(entry.name))
|
and (address := await mdns.async_resolve_host(entry.name))
|
||||||
):
|
):
|
||||||
|
# Use the IP address if available but only
|
||||||
|
# if the API is loaded and the device is online
|
||||||
|
# since MQTT logging will not work otherwise
|
||||||
port = address
|
port = address
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
Loading…
Reference in New Issue
Block a user