Skip to content

Commit 2344c2e

Browse files
kingy444pre-commit-ci[bot]fredrike
authored
Fix SSL Regression (#16)
* cleanup * use query string for set_zone * dont remove spaces in logging * Add messaging on why query params are required * Fix line too long * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix ssl regression * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Fredrik Erlandsson <[email protected]>
1 parent e669218 commit 2344c2e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Diff for: pydaikin/daikin_base.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Appliance(DaikinPowerMixin): # pylint: disable=too-many-public-methods
3232
"""Daikin main appliance class."""
3333

3434
base_url: str
35-
headers: Optional[dict] = None
35+
headers: dict = {}
3636
session: Optional[ClientSession]
3737
ssl_context: Optional[SSLContext] = None
3838

@@ -135,19 +135,17 @@ async def _get_resource(self, path: str, params: Optional[dict] = None):
135135
if params is None:
136136
params = {}
137137

138-
headers = self.headers
139-
if headers is None:
140-
headers = {}
141-
142-
_LOGGER.debug("Calling: %s/%s %s [%s]", self.base_url, path, params, headers)
138+
_LOGGER.debug(
139+
"Calling: %s/%s %s [%s]", self.base_url, path, params, self.headers
140+
)
143141

144142
# cannot manage session on outer async with or this will close the session
145143
# passed to pydaikin (homeassistant for instance)
146144
async with self.request_semaphore:
147145
async with self.session.get(
148146
f'{self.base_url}/{path}',
149147
params=params,
150-
headers=headers,
148+
headers=self.headers,
151149
ssl_context=self.ssl_context,
152150
) as response:
153151
if response.status == 403:

0 commit comments

Comments
 (0)