async def get_hap(self, hass: HomeAssistant, hapid: str, authtoken: str, name: str) -> AsyncHome: """Create a HomematicIP access point object.""" home = AsyncHome(hass.loop, async_get_clientsession(hass)) home.name = name home.label = 'Access Point' home.modelType = 'HmIP-HAP' home.set_auth_token(authtoken) try: await home.init(hapid) await home.get_current_state() except HmipConnectionError: raise HmipcConnectionError home.on_update(self.async_update) hass.loop.create_task(self.async_connect()) return home
async def get_hap(self, hass, hapid, authtoken, name): """Create a HomematicIP access point object.""" from homematicip.aio.home import AsyncHome from homematicip.base.base_connection import HmipConnectionError home = AsyncHome(hass.loop, async_get_clientsession(hass)) home.name = name home.label = 'Access Point' home.modelType = 'HmIP-HAP' home.set_auth_token(authtoken) try: await home.init(hapid) await home.get_current_state() except HmipConnectionError: raise HmipcConnectionError home.on_update(self.async_update) hass.loop.create_task(self.async_connect()) return home
async def get_hap(self, hass, hapid, authtoken, name): """Create a HomematicIP access point object.""" from homematicip.aio.home import AsyncHome from homematicip.base.base_connection import HmipConnectionError home = AsyncHome(hass.loop, async_get_clientsession(hass)) home.name = name home.label = 'Access Point' home.modelType = 'HmIP-HAP' home.set_auth_token(authtoken) try: await home.init(hapid) await home.get_current_state() except HmipConnectionError: raise HmipcConnectionError home.on_update(self.async_update) hass.loop.create_task(self.async_connect()) return home
async def get_hap(self, hass: HomeAssistant, hapid: str, authtoken: str, name: str) -> AsyncHome: """Create a HomematicIP access point object.""" home = AsyncHome(hass.loop, async_get_clientsession(hass)) home.name = name # Use the title of the config entry as title for the home. home.label = self.config_entry.title home.modelType = "HomematicIP Cloud Home" home.set_auth_token(authtoken) try: await home.init(hapid) await home.get_current_state() except HmipConnectionError as err: raise HmipcConnectionError from err home.on_update(self.async_update) home.on_create(self.async_create_entity) hass.loop.create_task(self.async_connect()) return home
async def get_hap( self, hass: HomeAssistantType, hapid: str, authtoken: str, name: str ) -> AsyncHome: """Create a HomematicIP access point object.""" home = AsyncHome(hass.loop, async_get_clientsession(hass)) home.name = name home.label = "Access Point" home.modelType = "HmIP-HAP" home.set_auth_token(authtoken) try: await home.init(hapid) await home.get_current_state() except HmipConnectionError: raise HmipcConnectionError home.on_update(self.async_update) home.on_create(self.async_create_entity) hass.loop.create_task(self.async_connect()) return home
def __init__(self, home: AsyncHome) -> None: """Initialize access point device.""" home.modelType = "HmIP-HAP" super().__init__(home, home)