qqaatw / JciHitachiHA

A home assistant integration for controlling Jci-Hitachi devices, using LibJciHitachi backend. 台灣日立雲端模組
Apache License 2.0
114 stars 31 forks source link

無法獲取裝置資料 #82

Closed LW-Ho closed 2 months ago

LW-Ho commented 2 months ago

🐛 Describe the bug

近期hitachi APP 更新至11.20.200 後,HA 1.7.1 版本就異常了。

以下是HA log

2024-06-09 01:04:09.870 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547407457312] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2741, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 977, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1049, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1676, in async_turn_on await self.hass.async_add_executor_job(ft.partial(self.turn_on, *kwargs)) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/jcihitachi_tw/humidifier.py", line 190, in turn_on self.update() File "/config/custom_components/jcihitachi_tw/init.py", line 232, in update result = api.set_status(vars(data)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/JciHitachi/api.py", line 1293, in set_status self._check_before_publish() File "/usr/local/lib/python3.12/site-packages/JciHitachi/api.py", line 953, in _check_before_publish if self._aws_tokens.expiration - current_time <= 300: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'expiration'

麻煩了,謝謝。

Environment Information

Core: 2024.6.0 Supervisor: 2024.06.0 Operating System: 12.3 Frontend: 20240605.0

JciHitachiHA version : 1.7.1

device models: RD-200HH1

qqaatw commented 2 months ago

Can people facing the same issue comment on this?

We would accept a PR that fixes this if it is indeed a problem.

LW-Ho commented 2 months ago

於HA 刪除該裝置,並再次透過此模組新增此裝置,則正常。