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 1818from iec_api .models .jwt import JWT
1919
2020from .const import (
21- CONF_TOTP_SECRET ,
22- DOMAIN ,
23- CONF_USER_ID ,
24- CONF_BP_NUMBER ,
2521 CONF_AVAILABLE_CONTRACTS ,
22+ CONF_BP_NUMBER ,
2623 CONF_SELECTED_CONTRACTS ,
24+ CONF_TOTP_SECRET ,
25+ CONF_USER_ID ,
26+ DOMAIN ,
2727)
2828
2929_LOGGER = logging .getLogger (__name__ )
@@ -150,11 +150,12 @@ async def async_step_mfa(
150150 schema = {}
151151
152152 schema [vol .Required (CONF_TOTP_SECRET )] = str
153- await client .login_with_id ()
153+ otp_type = await client .login_with_id ()
154154
155155 return self .async_show_form (
156156 step_id = "mfa" ,
157157 data_schema = vol .Schema (schema ),
158+ description_placeholders = {"otp_type" : otp_type },
158159 errors = errors ,
159160 )
160161
@@ -240,7 +241,7 @@ async def async_step_reauth_confirm(
240241 )
241242 client = self .client
242243
243- await client .login_with_id ()
244+ otp_type = await client .login_with_id ()
244245
245246 schema = {
246247 vol .Required (CONF_USER_ID ): self .reauth_entry .data [CONF_USER_ID ],
@@ -249,6 +250,7 @@ async def async_step_reauth_confirm(
249250
250251 return self .async_show_form (
251252 step_id = "reauth_confirm" ,
253+ description_placeholders = {"otp_type" : otp_type },
252254 data_schema = vol .Schema (schema ),
253255 errors = errors ,
254256 )
Original file line number Diff line number Diff line change 4343)
4444CONF_USER_ID = "user_id"
4545CONF_TOTP_SECRET = "totp_secret"
46+ CONF_TOTP_TYPE = "otp_type"
4647CONF_BP_NUMBER = "bp_number"
4748CONF_SELECTED_CONTRACTS = "selected_contracts"
4849CONF_AVAILABLE_CONTRACTS = "contracts"
Original file line number Diff line number Diff line change 88 "iot_class" : " cloud_polling" ,
99 "issue_tracker" : " https://github.com/guykh/iec-custom-component/issues" ,
1010 "loggers" : [" iec_api" ],
11- "requirements" : [" iec-api==0.4.11 " ],
11+ "requirements" : [" iec-api==0.4.12 " ],
1212 "version" : " 0.0.1"
1313}
Original file line number Diff line number Diff line change 7777 },
7878 "mfa" : {
7979 "title" : " OTP" ,
80- "description" : " Enter your One Time Password (OTP)" ,
80+ "description" : " Enter your One Time Password (OTP) sent to your {otp_type} " ,
8181 "data" : {
8282 "totp_secret" : " e.g. 123456"
8383 }
8888 },
8989 "reauth_confirm" : {
9090 "title" : " [%key:common::config_flow::title::reauth%]" ,
91+ "description" : " Enter your One Time Password (OTP) send to your {otp_type}" ,
9192 "data" : {
9293 "user_id" : " User ID" ,
9394 "totp_secret" : " e.g. 123456"
Original file line number Diff line number Diff line change 8080 },
8181 "mfa" : {
8282 "title" : " OTP" ,
83- "description" : " הכניסו את הקוד החד-פעמי שנשלח אליכם (OTP)" ,
83+ "description" : " הכניסו את הקוד החד-פעמי שנשלח אליכם (OTP) שנשלח ל-{otp_type} " ,
8484 "data" : {
8585 "totp_secret" : " לדוג' 123456"
8686 }
9191 },
9292 "reauth_confirm" : {
9393 "title" : " [%key:common::config_flow::title::reauth%]" ,
94+ "description" : " הכניסו את הקוד החד-פעמי שנשלח אליכם (OTP) שנשלח ל-{otp_type}" ,
9495 "data" : {
9596 "user_id" : " מזהה לקוח" ,
9697 "totp_secret" : " לדוג' 123456"
Original file line number Diff line number Diff line change 11colorlog >= 6.8.2
22homeassistant == 2024.2.0
3- iec-api == 0.4.11
3+ iec-api == 0.4.12
44pip >= 21.0
55ruff >= 0.5.6
You can’t perform that action at this time.
0 commit comments