1 """Support for Obihai Connectivity."""
3 from __future__
import annotations
5 from pyobihai
import PyObihai
7 from .const
import DEFAULT_PASSWORD, DEFAULT_USERNAME, LOGGER
15 """Retrieve an authenticated PyObihai."""
17 return PyObihai(host, username, password)
25 """Test if the given setting works as expected."""
29 login = obi.check_account()
31 LOGGER.debug(
"Invalid credentials")
38 """Contains a list of Obihai Sensors."""
43 username: str = DEFAULT_USERNAME,
44 password: str = DEFAULT_PASSWORD,
46 """Store configuration."""
47 self.sensors: list = []
55 self.
pyobihaipyobihai: PyObihai =
None
56 self.available: bool =
True
59 """Validate connection and retrieve a list of sensors."""
None __init__(self, str host, str username=DEFAULT_USERNAME, str password=DEFAULT_PASSWORD)
str|float get_state(dict[str, float] data, str key)
PyObihai|None validate_auth(str host, str username, str password)
PyObihai get_pyobihai(str host, str username, str password)
str|None get_device_serial(PyViCareDevice device)