Skip to content

Commit

Permalink
Disable MQTT with MQTT_DTOPIC #1232
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Jun 2, 2024
1 parent c1b78d0 commit e0beed3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/wyzebridge/hass.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def setup_hass(hass_token: Optional[str]) -> None:
except Exception as e:
logger.error(f"WEBRTC SETUP: {e}")

if environ.get("MQTT_HOST", "").lower() in {"false", "disable"}:
logger.info(f"[MQTT] DISABLED {MQTT_HOST=}")
else:
if environ.get("MQTT_DTOPIC", "").lower() == "homeassistant":
mqtt_conf = requests.get("http://supervisor/services/mqtt", headers=auth).json()
if "ok" in mqtt_conf.get("result") and (data := mqtt_conf.get("data")):
environ["MQTT_HOST"] = f'{data["host"]}:{data["port"]}'
Expand Down

0 comments on commit e0beed3

Please sign in to comment.