-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix BRP072C devices not working #13
Conversation
Thanks! I'll merge and release a new package in a while. |
New version published here: https://pypi.org/project/pydaikin/2.13.2/ |
Nice find, I think I did have a thought of this when reviewed the refactoring but it eventually slipped. |
@mattyway @fredrike Looks like this change broke non-BRP072C devices: home-assistant/core#123550 |
@mattyway Seem broke on my DaikinBRP069 Error log on HA:
The stack trace from library: (.venv) antonio in ~/py-test λ pydaikin -a 10.10.10.2
Exception in TaskGroup: 'DaikinBRP069' object has no attribute 'headers'
Traceback (most recent call last):
File "/home/antonio/py-test/.venv/bin/pydaikin", line 163, in <module>
run(main())
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/antonio/py-test/.venv/bin/pydaikin", line 139, in main
daikin = await DaikinFactory(args.device, key=args.key, password=args.password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/antonio/py-test/.venv/lib/python3.12/site-packages/pydaikin/factory.py", line 26, in __new__
await instance.__init__(*a, **kw)
File "/home/antonio/py-test/.venv/lib/python3.12/site-packages/pydaikin/factory.py", line 52, in __init__
await self._generated_object.update_status(
File "/home/antonio/py-test/.venv/lib/python3.12/site-packages/pydaikin/daikin_base.py", line 189, in update_status
self.values.update_by_resource(resource, task.result())
^^^^^^^^^^^^^
File "/home/antonio/py-test/.venv/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 189, in async_wrapped
return await copy(fn, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/antonio/py-test/.venv/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 111, in __call__
do = await self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/antonio/py-test/.venv/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 153, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/antonio/py-test/.venv/lib/python3.12/site-packages/tenacity/_utils.py", line 99, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/antonio/py-test/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 398, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/home/antonio/py-test/.venv/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 114, in __call__
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/antonio/py-test/.venv/lib/python3.12/site-packages/pydaikin/daikin_base.py", line 138, in _get_resource
headers = self.headers
^^^^^^^^^^^^
AttributeError: 'DaikinBRP069' object has no attribute 'headers'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7ff3e15d8710> |
headers
andssl_context
fields not being passed when making requests for a BRP072C devicessl:default [[SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1000)]
error