dmitry-cherkas / esphome-danfoss-eco

Extend Danfoss Eco eTRV BLE range over WiFi with ESPHome.
MIT License
21 stars 11 forks source link

Can't load component to ESPHome #6

Closed milten89 closed 1 year ago

milten89 commented 2 years ago

I've some problems while compiling ESPHome:

ERROR Unable to load component danfoss_eco.climate:
Traceback (most recent call last):
  File "/esphome/esphome/loader.py", line 162, in _lookup_module
    module = importlib.import_module(f"esphome.components.{domain}")
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/esphome/.esphome/external_components/085cc3fe/components/danfoss_eco/climate.py", line 74, in <module>
    cv.Optional(CONF_DEVICE_CLASS, default=DEVICE_CLASS_PROBLEM): binary_sensor.device_class
AttributeError: module 'esphome.components.binary_sensor' has no attribute 'device_class'

I'm using ESPHome 2022.3.0, added xxtea-iot-crypt@2.0.1 library and my configuration is:

climate:
  - platform: danfoss_eco
    name: "Bedroom - Danfos Eco"
    ble_client_id: bedroom_danfoss_eco
    secret_key: ******************************
    battery_level:
      name: "Bedroom - Danfos Eco - battery"
    temperature:
      name: "Bedroom - Danfos Eco - temperature"
    update_interval: 20min
milten89 commented 2 years ago

Commenting line 74 in climate.py (using Visual Studio Code Server) solve compilation problem. But I don't know if this line was important.

epe71 commented 2 years ago

I have the same problem. It looks like CONF_DEVICE_CLASS is not allowed anymore. I'm using ESPHOME version 2022.04

dmitry-cherkas commented 1 year ago

duplicate of #6