Пример #1
0
 async def get_auth(self, hass: HomeAssistantType, hapid, pin):
     """Create a HomematicIP access point object."""
     auth = AsyncAuth(hass.loop, async_get_clientsession(hass))
     try:
         await auth.init(hapid)
         if pin:
             auth.pin = pin
         await auth.connectionRequest("HomeAssistant")
     except HmipConnectionError:
         return False
     return auth
Пример #2
0
 async def get_auth(self, hass, hapid, pin):
     """Create a HomematicIP access point object."""
     auth = AsyncAuth(hass.loop, async_get_clientsession(hass))
     try:
         await auth.init(hapid)
         if pin:
             auth.pin = pin
         await auth.connectionRequest('HomeAssistant')
     except HmipConnectionError:
         return False
     return auth
Пример #3
0
 async def get_auth(self, opp: OpenPeerPower, hapid, pin):
     """Create a HomematicIP access point object."""
     auth = AsyncAuth(opp.loop, async_get_clientsession(opp))
     try:
         await auth.init(hapid)
         if pin:
             auth.pin = pin
         await auth.connectionRequest("OpenPeerPower")
     except HmipConnectionError:
         return None
     return auth
Пример #4
0
    async def get_auth(self, hass, hapid, pin):
        """Create a HomematicIP access point object."""
        from homematicip.aio.auth import AsyncAuth
        from homematicip.base.base_connection import HmipConnectionError

        auth = AsyncAuth(hass.loop, async_get_clientsession(hass))
        try:
            await auth.init(hapid)
            if pin:
                auth.pin = pin
            await auth.connectionRequest('HomeAssistant')
        except HmipConnectionError:
            return False
        return auth
Пример #5
0
    async def get_auth(self, hass, hapid, pin):
        """Create a HomematicIP access point object."""
        from homematicip.aio.auth import AsyncAuth
        from homematicip.base.base_connection import HmipConnectionError

        auth = AsyncAuth(hass.loop, async_get_clientsession(hass))
        print(auth)
        try:
            await auth.init(hapid)
            if pin:
                auth.pin = pin
            await auth.connectionRequest('HomeAssistant')
        except HmipConnectionError:
            return False
        return auth