Home Assistant Unofficial Reference 2024.12.1
utils.py
Go to the documentation of this file.
1 """Reusable utilities for the Plum Lightpad component."""
2 
3 from plumlightpad import Plum
4 
5 from homeassistant.core import HomeAssistant
6 from homeassistant.helpers.aiohttp_client import async_get_clientsession
7 
8 
9 async def load_plum(username: str, password: str, hass: HomeAssistant) -> Plum:
10  """Initialize Plum Lightpad API and load metadata stored in the cloud."""
11  plum = Plum(username, password)
12  cloud_web_session = async_get_clientsession(hass, verify_ssl=True)
13  await plum.loadCloudData(cloud_web_session)
14  return plum
Plum load_plum(str username, str password, HomeAssistant hass)
Definition: utils.py:9
aiohttp.ClientSession async_get_clientsession(HomeAssistant hass, bool verify_ssl=True, socket.AddressFamily family=socket.AF_UNSPEC, ssl_util.SSLCipherList ssl_cipher=ssl_util.SSLCipherList.PYTHON_DEFAULT)