al-one / hass-xiaomi-miot

Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成
https://miot-spec.com
Apache License 2.0
4.45k stars 625 forks source link

米家循环扇在日志中频繁报错 #1494

Open will-huang9531 opened 8 months ago

will-huang9531 commented 8 months ago

Device model / 设备型号

dmaker.fan.p28

Component version / 插件版本

0.7.1

HA core version / HA版本

2023.12.01

Integrated mode / 集成方式

Automatic (自动模式)

The problem / 问题详情

系统日志中频繁出现此报错

Entity attributes / 实体属性

preset_modes: Straight Wind, Natural Wind, Smart, Sleep oscillating: false percentage: 1 percentage_step: 1 preset_mode: Smart model: dmaker.fan.p28 lan_ip: mac_address: entity_class: MiotFanEntity home_room: miot_type: urn:miot-spec-v2:device:fan:0000A005:dmaker-p28:1 fan.on: false fan.fan_level: 2 fan.mode: 2 fan.horizontal_swing: false horizontal_swing_included_angle-2-5: 90 fan.vertical_swing: false vertical_swing_included_angle-2-8: 90 dm_service.speed_level: 1 dm_service.swing_all: false dm_service.off_to_center: true off_delay_time: 0 environment.temperature: 14.1 environment.relative_humidity: 51 physical_controls_locked: false alarm: false indicator_light.on: true state_updater: lan sub_entities: fan-2.horizontal_swing-4, fan-2.vertical_swing-7, alarm-5.alarm-1, off_delay_time-3.off_delay_time-1, fan-2.horizontal_swing_included_angle-5, fan-2.vertical_swing_included_angle-8, environment-9.temperature-1, environment-9.relative_humidity-2, physical_controls_locked-7.physical_controls_locked-1, indicator_light-4 friendly_name: 书房电风扇 Fan supported_features: 11

Home Assistant Logs / 系统日志

Logger: homeassistant.helpers.entity Source: helpers/entity.py:698 First occurred: 03:31:04 (25 occurrences) Last logged: 08:31:05

Update for fan.dmaker_p28_de49_fan fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 698, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 959, in async_device_update await self.async_update() File "/config/custom_components/xiaomi_miot/init.py", line 1366, in async_update results = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/xiaomi_miot/init.py", line 655, in get_properties_for_mapping return self.get_properties( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/miio/device.py", line 240, in get_properties values.extend(self.send(property_getter, _props[:max_properties])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/miio/device.py", line 107, in send return self._protocol.send( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/miio/miioprotocol.py", line 202, in send self.__id = payload["id"]


TypeError: byte indices must be integers or slices, not str
will-huang9531 commented 6 months ago

问题仍然存在