georgezhao2010/peacefair_energy

插件工作一段时间卡死,不更新数据

Opened this issue · 1 comments

HA core更新2024.7.1后插件出现问题,ha才启动一段短时间能够正常工作,之后不更新数据。python版本3.12.3,通过esphome的webserver查看培正模块工作正常。ha的报错日志如下:

日志记录器: custom_components.peacefair_energy.modbus
来源: custom_components/peacefair_energy/modbus.py:111
集成: Peacefair Energy Monitor (文档, 问题)
首次出现: 10:53:26 (1101 次总计出现)
上次记录: 13:35:32

Error in gathering, Caught blocking call to sleep with args (0.3,) inside the event loop by custom integration 'peacefair_energy' at custom_components/peacefair_energy/modbus.py, line 88: return self._client.read_input_registers(address, count, **kwargs). (offender: /opt/homeassistant/lib/python3.12/site-packages/pymodbus/transaction.py, line 271: time.sleep(delay)), please create a bug report at https://github.com/georgezhao2010/peacefair_energy/issue For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#sleep
Error in gathering, Caught blocking call to sleep with args (2,) inside the event loop by custom integration 'peacefair_energy' at custom_components/peacefair_energy/modbus.py, line 88: return self._client.read_input_registers(address, count, **kwargs). (offender: /opt/homeassistant/lib/python3.12/site-packages/pymodbus/framer/rtu_framer.py, line 215: time.sleep(self.client.comm_params.timeout_connect)), please create a bug report at https://github.com/georgezhao2010/peacefair_energy/issue For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#sleep

补充错误日志:

日志记录器: homeassistant.const
来源: helpers/deprecation.py:197
首次出现: 10:38:30 (26 次总计出现)
上次记录: 10:38:43

ELECTRIC_CURRENT_AMPERE was used from peacefair_energy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricCurrent.AMPERE instead, please report it to the author of the 'peacefair_energy' custom integration
POWER_WATT was used from peacefair_energy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.WATT instead, please report it to the author of the 'peacefair_energy' custom integration
ENERGY_KILO_WATT_HOUR was used from peacefair_energy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please report it to the author of the 'peacefair_energy' custom integration
FREQUENCY_HERTZ was used from peacefair_energy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfFrequency.HERTZ instead, please report it to the author of the 'peacefair_energy' custom integration
TEMP_CELSIUS was used from midea_ac_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please report it to the author of the 'midea_ac_lan' custom integration

我的也是这样,如何解决?