本帖最后由 fevenor 于 2020-11-15 10:05 编辑
账号设置成功了,但是初始化配置报错了
2020-11-15 09:57:46 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up lynkco platform for device_tracker
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/lynkco/device_tracker.py", line 36, in async_setup_entry
devices.append(LynkCOEntity(hass, coordinator, i))
File "/config/custom_components/lynkco/device_tracker.py", line 48, in __init__
self._unique_id = coordinator.data[vin]["result"]['vin']
KeyError: 'vin'
2020-11-15 09:57:46 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up lynkco platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/lynkco/sensor.py", line 38, in async_setup_entry
sensors.append(LynkCoSensor(i, sensor, coordinator))
File "/config/custom_components/lynkco/sensor.py", line 51, in __init__
self._unique_id = coordinator.data[vin]["result"]['vin']
KeyError: 'vin'
2020-11-15 09:57:46 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up lynkco platform for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/lynkco/binary_sensor.py", line 38, in async_setup_entry
binary_sensor.append(LynkCoBinarySensor(i, sensor, coordinator))
File "/config/custom_components/lynkco/binary_sensor.py", line 51, in __init__
self._unique_id = coordinator.data[vin]["result"]['vin']
KeyError: 'vin'
我参考你的代码使用postman调用接口,是可以成功的
|