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.38k stars 614 forks source link

Breaking changes in HA 2024.1 beta #1463

Open codyc1515 opened 8 months ago

codyc1515 commented 8 months ago

Integration is failing to load in 2024.1 due to following error.

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:894
First occurred: December 30, 2023 at 23:57:55 (12 occurrences)
Last logged: 00:08:54

Update for vacuum.kitchen_robot fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 894, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1212, in async_device_update
    await self.async_update()
  File "/config/custom_components/xiaomi_miot/vacuum.py", line 121, in async_update
    await super().async_update()
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1510, in async_update
    await self.async_update_for_main_entity()
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1551, in async_update_for_main_entity
    self._update_sub_entities(
  File "/config/custom_components/xiaomi_miot/__init__.py", line 2127, in _update_sub_entities
    self._subs[fnm] = MiotSensorSubEntity(self, p, option=opt)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/sensor.py", line 490, in __init__
    super().__init__(parent, miot_property, option, domain=ENTITY_DOMAIN)
  File "/config/custom_components/xiaomi_miot/__init__.py", line 2524, in __init__
    self._attr_native_unit_of_measurement = miot_property.unit_of_measurement
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/core/miot_spec.py", line 748, in unit_of_measurement
    'celsius': TEMP_CELSIUS,
               ^^^^^^^^^^^^
NameError: name 'TEMP_CELSIUS' is not defined
codyc1515 commented 8 months ago

1461

1459

javato commented 8 months ago

The fix for this issue is already merged, isn't it? When a new release will be created so we can update our integration? Thanks a lot!