本帖最后由 栩寒 于 2020-3-17 22:31 编辑
大佬,实在搞不定了,请教一下报错原因
自建技能方式,公网ip、ssl证书都正常,技能授权成功,havcs.reload可以生成设备信息,小度无法发现设备
homeassistant日志
2020-03-17 21:55:26 DEBUG (MainThread) [custom_components.havcs] [http] -------- start handle task from http at 2020-03-17 21:55:26 --------
2020-03-17 21:55:26 DEBUG (MainThread) [custom_components.havcs] [http] raw message: {"header":{"payloadVersion":"1","name":"DiscoverAppliancesRequest","namespace":"DuerOS.ConnectedHome.Discovery","messageId":"f20288f0-6856-11ea-8b7f-0304fcba2402_DCS-10-201-43-32-8260-0317215522-525521_8#1_0_Smarthome_5e70d6ce13ec20.85258211"},"payload":{"accessToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjMTJhMGJlZmU5NGI0NmZlODVkNmZmYWFkMzZlODQ4NyIsImlhdCI6MTU4NDQ0OTMzMCwiZXhwIjoxNTg0NTM1NzMwfQ.Bqgm5LXm3c0yApazrfm-oV5h9YikCmKzqkGhfn7cWoA","openUid":"eed9c98a711c6918972975ec51d69d70"}}
2020-03-17 21:55:26 DEBUG (MainThread) [custom_components.havcs] [http] get access_token >>> eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjMTJhMGJlZmU5NGI0NmZlODVkNmZmYWFkMzZlODQ4NyIsImlhdCI6MTU4NDQ0OTMzMCwiZXhwIjoxNTg0NTM1NzMwfQ.Bqgm5LXm3c0yApazrfm-oV5h9YikCmKzqkGhfn7cWoA <<<
2020-03-17 21:55:26 DEBUG (MainThread) [custom_components.havcs] [http] validate access_token, get refresh_token(id = c12a0befe94b46fe85d6ffaad36e8487)
2020-03-17 21:55:26 INFO (MainThread) [custom_components.havcs.dueros] [dueros] Handle Request:
{'header': {'payloadVersion': '1', 'name': 'DiscoverAppliancesRequest', 'namespace': 'DuerOS.ConnectedHome.Discovery', 'messageId': 'f20288f0-6856-11ea-8b7f-0304fcba2402_DCS-10-201-43-32-8260-0317215522-525521_8#1_0_Smarthome_5e70d6ce13ec20.85258211'}, 'payload': {'accessToken': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjMTJhMGJlZmU5NGI0NmZlODVkNmZmYWFkMzZlODQ4NyIsImlhdCI6MTU4NDQ0OTMzMCwiZXhwIjoxNTg0NTM1NzMwfQ.Bqgm5LXm3c0yApazrfm-oV5h9YikCmKzqkGhfn7cWoA', 'openUid': 'eed9c98a711c6918972975ec51d69d70'}}
2020-03-17 21:55:26 ERROR (MainThread) [custom_components.havcs] [http] handle fail: Traceback (most recent call last):
File "/config/custom_components/havcs/__init__.py", line 657, in post
response = await HANDLER[platform].handleRequest(json.loads(data), refresh_token)
File "/config/custom_components/havcs/dueros.py", line 197, in handleRequest
err_result, discovery_devices, entity_ids = self.process_discovery_command()
File "/config/custom_components/havcs/helper.py", line 55, in process_discovery_command
properties = self._discovery_process_propertites(device_properties)
File "/config/custom_components/havcs/dueros.py", line 268, in _discovery_process_propertites
properties += [{'name': name, 'value': value, 'scale': scale, 'timestampOfSample': int(time.time()), 'uncertaintyInMilliseconds': 1000, 'legalValue': legalValue }]
UnboundLocalError: local variable 'scale' referenced before assignment
2020-03-17 21:55:26 DEBUG (MainThread) [custom_components.havcs] [http] -------- http task finish at 2020-03-17 21:55:26, running time: 0.04833s --------
|