Skip to content
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

Device Became unavailable #86

Open
mac-zhou opened this issue Aug 26, 2021 · 2 comments
Open

Device Became unavailable #86

mac-zhou opened this issue Aug 26, 2021 · 2 comments

Comments

@mac-zhou
Copy link
Owner

mac-zhou commented Aug 26, 2021

This issue is often mentioned by users.
There are several reasons:

  1. bug
  2. encode wrong
  3. reply takes too long time
  4. device's reply is null
  5. timeout
  6. session closed

most reasons are 4-6.
many users don’t care about timeout at all, they care about too many errors and unavailable.
so, i'm thinking about to keep device's old state, when 4-6 occurred.

@mac-zhou
Copy link
Owner Author

next veriosn will fix, when responses is null, keep last state.
the warn and error log will also output to locating the problem.

@civarson
Copy link

Is this the same thing?

Logger: homeassistant.helpers.entity
Source: custom_components/midea_ac/climate.py:129
Integration: midea_ac (documentation)
First occurred: 9:32:07 AM (1214 occurrences)
Last logged: 2:35:25 PM

Update for climate.office_mini_split fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 641, in async_device_update
raise exc
File "/config/custom_components/midea_ac/climate.py", line 129, in async_update
await self.hass.async_add_executor_job(self._device.apply)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/msmart/device.py", line 264, in apply
self._send_cmd(cmd)
File "/usr/local/lib/python3.9/site-packages/msmart/device.py", line 208, in _send_cmd
responses = self._lan_service.appliance_transparent_send_8370(data)
File "/usr/local/lib/python3.9/site-packages/msmart/lan.py", line 136, in appliance_transparent_send_8370
data = self.security.encode_8370(data, msgtype)
File "/usr/local/lib/python3.9/site-packages/msmart/security.py", line 117, in encode_8370
data = self.aes_cbc_encrypt(data, self._tcp_key) + sign
File "/usr/local/lib/python3.9/site-packages/msmart/security.py", line 57, in aes_cbc_encrypt
return AES.new(key, AES.MODE_CBC, iv=self.iv).encrypt(raw)
File "/usr/local/lib/python3.9/site-packages/Cryptodome/Cipher/AES.py", line 232, in new
return _create_cipher(sys.modules[name], key, mode, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/Cryptodome/Cipher/init.py", line 79, in _create_cipher
return modes[mode](factory, **kwargs)
File "/usr/local/lib/python3.9/site-packages/Cryptodome/Cipher/_mode_cbc.py", line 274, in _create_cbc_cipher
cipher_state = factory._create_base_cipher(kwargs)
File "/usr/local/lib/python3.9/site-packages/Cryptodome/Cipher/AES.py", line 92, in _create_base_cipher
if len(key) not in key_size:
TypeError: object of type 'NoneType' has no len()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants