Home Assistant Unofficial Reference 2024.12.1
hassio.py
Go to the documentation of this file.
1 """Hass.io helper."""
2 
3 import os
4 
5 from homeassistant.core import HomeAssistant, callback
6 
7 
8 @callback
9 def is_hassio(hass: HomeAssistant) -> bool:
10  """Return true if Hass.io is loaded.
11 
12  Async friendly.
13  """
14  return "hassio" in hass.config.components
15 
16 
17 @callback
18 def get_supervisor_ip() -> str | None:
19  """Return the supervisor ip address."""
20  if "SUPERVISOR" not in os.environ:
21  return None
22  return os.environ["SUPERVISOR"].partition(":")[0]
bool is_hassio(HomeAssistant hass)
Definition: hassio.py:9
str|None get_supervisor_ip()
Definition: hassio.py:18