|
发表于 2022-5-8 13:44:37
|
显示全部楼层
本帖最后由 liqx 于 2022-5-8 14:52 编辑
谢谢您的分享,下载您分享的附件后直接使用编译成功,正常使用。
原来 my_components 这个文件夹名称是不能改的。红外遥控能正常使用.
配置文件中加入温湿度代码提示错误。
配置代码:
sensor:
- platform: meizu_ble
update_interval: 180s
mac_address: 68:3e:34:xx:xx:xx
temperature:
name: "Meizu Temperature"
humidity:
name: "Meizu Humidity"
battery_level:
name: "Meizu Battery"
这一行 - platform: meizu_ble 前面出现红叉
编译报错:
INFO Reading configuration /config/esp32-meizu.yaml...ERROR Unable to load component meizu_ble.sensor: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/my_components/meizu_ble/sensor.py", line 15, in <module> cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema(UNIT_CELSIUS, ICON_THERMOMETER, 1),TypeError: sensor_schema() takes from 0 to 1 positional arguments but 3 were givenFailed configsensor.meizu_ble: [source /config/esp32-meizu.yaml:36] Platform not found: 'sensor.meizu_ble'. platform: meizu_ble update_interval: 180s mac_address: 68:3e:34:xx:xx:xx temperature: name: Meizu Temperature humidity: name: Meizu Humidity battery_level: name: Meizu Battery
|
|