File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 5
5
6
6
from .util_http import request_with_logging
7
7
from .const import API_KEY
8
- from .errors import AuthError
8
+ from .errors import LoginError
9
9
10
10
_LOGGER = logging .getLogger (__name__ )
11
11
@@ -69,6 +69,8 @@ async def _get_home_host(self) -> str:
69
69
url = url , headers = headers
70
70
)
71
71
)
72
+ if response .status == 404 :
73
+ raise LoginError ("invalid username" )
72
74
return (await response .text ()).replace ('"' , "" )
73
75
74
76
async def _get_auth_token (self ) -> str :
@@ -91,11 +93,11 @@ async def _get_auth_token(self) -> str:
91
93
)
92
94
result = await response .text ()
93
95
if response .status == 404 :
94
- raise AuthError ("invalid username" )
96
+ raise LoginError ("invalid username" )
95
97
if result == "true" :
96
98
return response .headers ["X-AUTH-TOKEN" ]
97
99
else :
98
- raise AuthError ("invalid password" )
100
+ raise LoginError ("invalid password" )
99
101
100
102
async def get_devices (self ) -> list [dict [str , any ]]:
101
103
"""
You can’t perform that action at this time.
0 commit comments