diff --git a/pydaikin/daikin_base.py b/pydaikin/daikin_base.py index c0386f0..69824d4 100644 --- a/pydaikin/daikin_base.py +++ b/pydaikin/daikin_base.py @@ -144,7 +144,7 @@ async def _get_resource(self, path: str, params: Optional[dict] = None): "Calling: %s/%s %s [%s]", self.base_url, path, - {**params, **{"pass": "****"}}, + params if "pass" not in params else {**params, **{"pass": "****"}}, self.headers, ) diff --git a/pydaikin/daikin_skyfi.py b/pydaikin/daikin_skyfi.py index 46b9e9a..c8e0d72 100644 --- a/pydaikin/daikin_skyfi.py +++ b/pydaikin/daikin_skyfi.py @@ -3,6 +3,8 @@ import logging from urllib.parse import unquote +from aiohttp import ClientSession + from .daikin_base import Appliance _LOGGER = logging.getLogger(__name__) @@ -50,12 +52,11 @@ class DaikinSkyFi(Appliance): def __init__( self, device_id: str, + session: ClientSession | None, password: str, - session=None, ) -> None: """Init the pydaikin appliance, representing one Daikin SkyFi device.""" super().__init__(device_id, session) - # self.device_ip = f'{self.device_ip}' self.base_url = f"http://{self.device_ip}:2000" self._password = password diff --git a/pydaikin/factory.py b/pydaikin/factory.py index d102e52..28f7a20 100644 --- a/pydaikin/factory.py +++ b/pydaikin/factory.py @@ -37,11 +37,7 @@ async def __init__( """Factory to init the corresponding Daikin class.""" if password is not None: - self._generated_object = DaikinSkyFi( - device_id, - password=password, - session=session, - ) + self._generated_object = DaikinSkyFi(device_id, session, password) elif key is not None: self._generated_object = DaikinBRP072C( device_id,