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

大佬,loock_v4_d918_lock从0.65开始报错了 #612

Closed
yuyuye84 opened this issue May 24, 2022 · 2 comments
Closed

大佬,loock_v4_d918_lock从0.65开始报错了 #612

yuyuye84 opened this issue May 24, 2022 · 2 comments
Labels
bug Something isn't working device: lock fixed bug fixed

Comments

@yuyuye84
Copy link

yuyuye84 commented May 24, 2022

大佬,最近loock_v4_d918_lock报错了,相关两个实体不再可用,报错日志如下。
我记得在0.65之前应该是正常的。

Logger: homeassistant.helpers.entity
Source: components/sensor/__init__.py:408
First occurred: 13:13:58 (151 occurrences)
Last logged: 14:28:57

Update for sensor.loock_v4_d918_lock fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 397, in state
    if value.tzinfo is None:
AttributeError: 'str' object has no attribute 'tzinfo'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 515, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 743, in async_device_update
    raise exc
  File "/config/custom_components/xiaomi_miot/sensor.py", line 190, in async_update
    await self.async_update_attrs({
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1046, in async_update_attrs
    return await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1040, in update_attrs
    self._update_attr_sensor_entities(pls, domain='sensor')
  File "/config/custom_components/xiaomi_miot/__init__.py", line 978, in _update_attr_sensor_entities
    self._subs[p].update_from_parent()
  File "/config/custom_components/xiaomi_miot/__init__.py", line 2277, in update_from_parent
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 408, in state
    raise ValueError(
ValueError: Invalid datetime: sensor.loock_v4_d918_timestamp has a timestamp device class but does not provide a datetime state but <class 'str'>
al-one added a commit that referenced this issue May 25, 2022
@al-one al-one added bug Something isn't working fixed bug fixed labels May 25, 2022
@al-one
Copy link
Owner

al-one commented May 25, 2022

已修复,请更新至master分支

@a451435623
Copy link

更新master分支后,loock.lock.v1恢复正常了,亲测有效

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working device: lock fixed bug fixed
Projects
None yet
Development

No branches or pull requests

3 participants