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

[Bug]: 杜亚窗帘的控制功能始终处于不可用的状态 #85

Closed
A-Cepheus opened this issue Dec 17, 2024 · 3 comments · Fixed by #95
Closed

[Bug]: 杜亚窗帘的控制功能始终处于不可用的状态 #85

A-Cepheus opened this issue Dec 17, 2024 · 3 comments · Fixed by #95
Assignees
Labels
bug Something isn't working

Comments

@A-Cepheus
Copy link

Describe the bug / 描述问题

型号杜亚M1、M2,其他信息和开关正常,唯独开合控制处于不可用

To Reproduce / 复现步骤

添加账号与设备后即处于不可用状态

Expected behavior / 预期结果

应该是可以控制打开和关闭的

Home Assistant Logs / 系统日志

可能相关的日志:
2024-12-17 07:20:20.714 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback MIoTServiceEntity.__write_ha_state_handler() (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run
self._context.run(self._callback, *self._args)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/xiaomi_home/miot/miot_device.py", line 965, in __write_ha_state_handler
self.async_write_ha_state()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
self._async_write_ha_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
self.__async_calculate_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1085, in __async_calculate_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1029, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/cover/init.py", line 322, in state
if self.is_opening:
^^^^^^^^^^^^^^^
File "/config/custom_components/xiaomi_home/cover.py", line 226, in is_opening
prop=self._prop_status) == self._prop_status_opening
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Cover' object has no attribute '_prop_status_opening'

Home Assistant Core version / Home Assistant Core 版本

2024.12.1

Home Assistant Operation System version / Home Assistant Operation System 版本

docker

Xiaomi Home integration version / 米家集成版本

v0.1.0

Additional context / 其他说明

image

@A-Cepheus A-Cepheus added the bug Something isn't working label Dec 17, 2024
@A-Cepheus
Copy link
Author

据我理解,有_prop_status是不是_prop_status_opening也不一定赋值了,

self._prop_status_opening = item['value']

如果有_prop_status就返回_prop_status_opening是不是不太合理
prop=self._prop_status) == self._prop_status_opening

@topsworld topsworld self-assigned this Dec 17, 2024
@topsworld
Copy link
Contributor

好的,问题下个版本修复

@topsworld topsworld linked a pull request Dec 17, 2024 that will close this issue
@A-Cepheus
Copy link
Author

WFM, thanks!

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

Successfully merging a pull request may close this issue.

2 participants