Skip to content

Commit

Permalink
Add verify tls option
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed May 8, 2024
1 parent 756783c commit 1f18398
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
11 changes: 5 additions & 6 deletions custom_components/livebox/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config flow to configure Livebox."""

from __future__ import annotations

from collections.abc import Mapping
Expand All @@ -18,12 +19,7 @@
from homeassistant import config_entries
from homeassistant.components import ssdp
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_USERNAME,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers import config_validation as cv
Expand All @@ -33,6 +29,7 @@
CONF_LAN_TRACKING,
CONF_TRACKING_TIMEOUT,
CONF_USE_TLS,
CONF_VERIFY_TLS,
DEFAULT_HOST,
DEFAULT_LAN_TRACKING,
DEFAULT_PORT,
Expand All @@ -48,6 +45,7 @@
vol.Required(CONF_PASSWORD): str,
vol.Required(CONF_PORT, default=DEFAULT_PORT): cv.port,
vol.Required(CONF_USE_TLS, default=False): bool,
vol.Required(CONF_VERIFY_TLS, default=True): bool,
}
)

Expand Down Expand Up @@ -83,6 +81,7 @@ async def async_step_user(
host=user_input[CONF_HOST],
port=user_input[CONF_PORT],
use_tls=user_input[CONF_USE_TLS],
verify_tls=user_input[CONF_VERIFY_TLS],
)
await api.async_connect()
await api.async_get_permissions()
Expand Down
1 change: 1 addition & 0 deletions custom_components/livebox/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

CALLID = "callId"
CONF_USE_TLS = "use_tls"
CONF_VERIFY_TLS = "verify_tls"
CONF_LAN_TRACKING = "lan_tracking"
DEFAULT_LAN_TRACKING = False

Expand Down
3 changes: 2 additions & 1 deletion custom_components/livebox/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]",
"port": "[%key:common::config_flow::data::port%]",
"use_tls": "Use TLS"
"use_tls": "Use TLS",
"verify_tls": "Verify TLS"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion custom_components/livebox/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"username": "Username",
"password": "Password",
"port": "Port",
"use_tls": "Use SSL"
"use_tls": "Use TSL",
"verify_tls": "Verify TLS"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion custom_components/livebox/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"username": "Utilisateur",
"password": "Mot de passe",
"port": "Port",
"use_tls": "Utiliser SSL/TLS"
"use_tls": "Utiliser SSL/TLS",
"verify_tls": "Verify SSL/TLS"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions custom_components/livebox/translations/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"username": "Brukernavn",
"password": "Passord",
"port": "Port",
"use_tls": "Use TSL",
"verify_ssl": "SSL/TLS"
}
}
Expand Down

0 comments on commit 1f18398

Please sign in to comment.