Skip to content

Commit 5002b19

Browse files
committed
Removed 'Verify SSL' from config_flow, updated manifest and release to 0.4.6
1 parent 821091f commit 5002b19

File tree

5 files changed

+11
-27
lines changed

5 files changed

+11
-27
lines changed

custom_components/plex_recently_added/__init__.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
CONF_NAME,
77
CONF_API_KEY,
88
CONF_HOST,
9-
CONF_PORT,
9+
CONF_PORT,
1010
CONF_SSL
11-
)
11+
)
1212

1313
from .const import (
1414
DOMAIN,
@@ -17,10 +17,8 @@
1717
CONF_SECTION_TYPES,
1818
CONF_SECTION_LIBRARIES,
1919
CONF_EXCLUDE_KEYWORDS,
20-
CONF_ON_DECK,
21-
CONF_VERIFY_SSL
22-
)
23-
20+
CONF_ON_DECK
21+
)
2422

2523
from .coordinator import PlexDataCoordinator
2624
from .helpers import setup_client
@@ -29,7 +27,6 @@
2927
)
3028
from .redirect import ImagesRedirect
3129

32-
3330
PLATFORMS = [
3431
Platform.SENSOR
3532
]
@@ -48,7 +45,6 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
4845
config_entry.data.get(CONF_SECTION_TYPES, []),
4946
config_entry.data.get(CONF_SECTION_LIBRARIES, []),
5047
config_entry.data.get(CONF_EXCLUDE_KEYWORDS, []),
51-
config_entry.data[CONF_VERIFY_SSL],
5248
)
5349
except FailedToLogin as err:
5450
raise ConfigEntryNotReady("Failed to Log-in") from err

custom_components/plex_recently_added/config_flow.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from typing import Any
2-
32
import voluptuous as vol
43

54
from homeassistant.helpers.selector import (
@@ -20,7 +19,7 @@
2019
CONF_HOST,
2120
CONF_PORT,
2221
CONF_SSL
23-
)
22+
)
2423

2524
from .const import (
2625
DOMAIN,
@@ -32,9 +31,8 @@
3231
CONF_EXCLUDE_KEYWORDS,
3332
CONF_SECTION_LIBRARIES_LABEL,
3433
CONF_EXCLUDE_KEYWORDS_LABEL,
35-
CONF_ON_DECK,
36-
CONF_VERIFY_SSL
37-
)
34+
CONF_ON_DECK
35+
)
3836

3937
from .helpers import setup_client
4038
from .plex_api import (
@@ -48,7 +46,6 @@
4846
vol.Required(CONF_PORT, default=32400): vol.All(vol.Coerce(int), vol.Range(min=0)),
4947
vol.Required(CONF_API_KEY): vol.All(str),
5048
vol.Optional(CONF_SSL, default=False): vol.All(bool),
51-
vol.Optional(CONF_VERIFY_SSL, default=True): vol.All(bool),
5249
vol.Optional(CONF_MAX, default=5): vol.All(vol.Coerce(int), vol.Range(min=0)),
5350
vol.Optional(CONF_ON_DECK, default=False): vol.All(bool),
5451
vol.Optional(CONF_SECTION_TYPES, default={"movie", "show"}): SelectSelector(SelectSelectorConfig(options=ALL_SECTION_TYPES, mode=SelectSelectorMode.DROPDOWN ,multiple=True)),
@@ -85,7 +82,6 @@ async def async_step_user(
8582
user_input.get(CONF_SECTION_TYPES, []),
8683
user_input.get(CONF_SECTION_LIBRARIES, []),
8784
user_input.get(CONF_EXCLUDE_KEYWORDS, []),
88-
user_input[CONF_VERIFY_SSL],
8985
)
9086
except FailedToLogin as err:
9187
errors = {'base': 'failed_to_login'}

custom_components/plex_recently_added/helpers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ async def setup_client(
1313
section_types: list,
1414
section_libraries: list,
1515
exclude_keywords: list,
16-
verify_ssl: bool,
17-
):
18-
client = PlexApi(hass, name, ssl, token, max, on_deck, host, port, section_types, section_libraries, exclude_keywords, verify_ssl)
16+
):
17+
client = PlexApi(hass, name, ssl, token, max, on_deck, host, port, section_types, section_libraries, exclude_keywords)
1918

2019
await client.update()
2120
return client

custom_components/plex_recently_added/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"iot_class": "local_polling",
1010
"issue_tracker": "https://github.com/custom-components/sensor.plex_recently_added/issues",
1111
"requirements": [],
12-
"version": "0.4.4"
12+
"version": "0.4.6"
1313
}

custom_components/plex_recently_added/plex_api.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ def __init__(
2525
port: int,
2626
section_types: list,
2727
section_libraries: list,
28-
exclude_keywords: list,
29-
verify_ssl: bool
28+
exclude_keywords: list
3029
):
3130
self._hass = hass
3231
self._ssl = 's' if ssl else ''
@@ -38,7 +37,6 @@ def __init__(
3837
self._section_types = section_types
3938
self._section_libraries = section_libraries
4039
self._exclude_keywords = exclude_keywords
41-
self._verify_ssl = verify_ssl
4240
self._images_base_url = f'/{name.lower() + "_" if len(name) > 0 else ""}plex_recently_added'
4341

4442
async def update(self):
@@ -49,8 +47,6 @@ async def update(self):
4947
)
5048

5149
""" Getting the server identifier """
52-
if not self._verify_ssl:
53-
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
5450
try:
5551
info_res = await self._hass.async_add_executor_job(
5652
requests.get,
@@ -60,7 +56,6 @@ async def update(self):
6056
"User-agent": USER_AGENT,
6157
"Accept": ACCEPTS,
6258
},
63-
"verify":self._verify_ssl,
6459
"timeout":10
6560
}
6661
)
@@ -87,7 +82,6 @@ async def update(self):
8782
"User-agent": USER_AGENT,
8883
"Accept": ACCEPTS,
8984
},
90-
"verify":self._verify_ssl,
9185
"timeout":10
9286
}
9387
)
@@ -117,7 +111,6 @@ async def update(self):
117111
"User-agent": USER_AGENT,
118112
"Accept": ACCEPTS,
119113
},
120-
"verify":self._verify_ssl,
121114
"timeout":10
122115
}
123116
)

0 commit comments

Comments
 (0)