File tree Expand file tree Collapse file tree 6 files changed +15
-10
lines changed Expand file tree Collapse file tree 6 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 18
18
from iec_api .models .jwt import JWT
19
19
20
20
from .const import (
21
- CONF_TOTP_SECRET ,
22
- DOMAIN ,
23
- CONF_USER_ID ,
24
- CONF_BP_NUMBER ,
25
21
CONF_AVAILABLE_CONTRACTS ,
22
+ CONF_BP_NUMBER ,
26
23
CONF_SELECTED_CONTRACTS ,
24
+ CONF_TOTP_SECRET ,
25
+ CONF_USER_ID ,
26
+ DOMAIN ,
27
27
)
28
28
29
29
_LOGGER = logging .getLogger (__name__ )
@@ -150,11 +150,12 @@ async def async_step_mfa(
150
150
schema = {}
151
151
152
152
schema [vol .Required (CONF_TOTP_SECRET )] = str
153
- await client .login_with_id ()
153
+ otp_type = await client .login_with_id ()
154
154
155
155
return self .async_show_form (
156
156
step_id = "mfa" ,
157
157
data_schema = vol .Schema (schema ),
158
+ description_placeholders = {"otp_type" : otp_type },
158
159
errors = errors ,
159
160
)
160
161
@@ -240,7 +241,7 @@ async def async_step_reauth_confirm(
240
241
)
241
242
client = self .client
242
243
243
- await client .login_with_id ()
244
+ otp_type = await client .login_with_id ()
244
245
245
246
schema = {
246
247
vol .Required (CONF_USER_ID ): self .reauth_entry .data [CONF_USER_ID ],
@@ -249,6 +250,7 @@ async def async_step_reauth_confirm(
249
250
250
251
return self .async_show_form (
251
252
step_id = "reauth_confirm" ,
253
+ description_placeholders = {"otp_type" : otp_type },
252
254
data_schema = vol .Schema (schema ),
253
255
errors = errors ,
254
256
)
Original file line number Diff line number Diff line change 43
43
)
44
44
CONF_USER_ID = "user_id"
45
45
CONF_TOTP_SECRET = "totp_secret"
46
+ CONF_TOTP_TYPE = "otp_type"
46
47
CONF_BP_NUMBER = "bp_number"
47
48
CONF_SELECTED_CONTRACTS = "selected_contracts"
48
49
CONF_AVAILABLE_CONTRACTS = "contracts"
Original file line number Diff line number Diff line change 8
8
"iot_class" : " cloud_polling" ,
9
9
"issue_tracker" : " https://github.com/guykh/iec-custom-component/issues" ,
10
10
"loggers" : [" iec_api" ],
11
- "requirements" : [" iec-api==0.4.11 " ],
11
+ "requirements" : [" iec-api==0.4.12 " ],
12
12
"version" : " 0.0.1"
13
13
}
Original file line number Diff line number Diff line change 77
77
},
78
78
"mfa" : {
79
79
"title" : " OTP" ,
80
- "description" : " Enter your One Time Password (OTP)" ,
80
+ "description" : " Enter your One Time Password (OTP) sent to your {otp_type} " ,
81
81
"data" : {
82
82
"totp_secret" : " e.g. 123456"
83
83
}
88
88
},
89
89
"reauth_confirm" : {
90
90
"title" : " [%key:common::config_flow::title::reauth%]" ,
91
+ "description" : " Enter your One Time Password (OTP) send to your {otp_type}" ,
91
92
"data" : {
92
93
"user_id" : " User ID" ,
93
94
"totp_secret" : " e.g. 123456"
Original file line number Diff line number Diff line change 80
80
},
81
81
"mfa" : {
82
82
"title" : " OTP" ,
83
- "description" : " הכניסו את הקוד החד-פעמי שנשלח אליכם (OTP)" ,
83
+ "description" : " הכניסו את הקוד החד-פעמי שנשלח אליכם (OTP) שנשלח ל-{otp_type} " ,
84
84
"data" : {
85
85
"totp_secret" : " לדוג' 123456"
86
86
}
91
91
},
92
92
"reauth_confirm" : {
93
93
"title" : " [%key:common::config_flow::title::reauth%]" ,
94
+ "description" : " הכניסו את הקוד החד-פעמי שנשלח אליכם (OTP) שנשלח ל-{otp_type}" ,
94
95
"data" : {
95
96
"user_id" : " מזהה לקוח" ,
96
97
"totp_secret" : " לדוג' 123456"
Original file line number Diff line number Diff line change 1
1
colorlog >= 6.8.2
2
2
homeassistant == 2024.2.0
3
- iec-api == 0.4.11
3
+ iec-api == 0.4.12
4
4
pip >= 21.0
5
5
ruff >= 0.5.6
You can’t perform that action at this time.
0 commit comments