1010
1111async def async_setup (hass , config ):
1212 websocket_api .async_register_command (hass , websocket_create )
13- hass .states .async_set (DOMAIN + ".version" , 4 )
1413 return True
1514
15+ async def async_setup_entry (hass , entry ):
16+ websocket_api .async_register_command (hass , websocket_create )
17+ return True
1618
1719@websocket_api .require_admin
1820@websocket_api .async_response
@@ -29,6 +31,7 @@ async def async_setup(hass, config):
2931async def websocket_create (hass , connection , msg ):
3032 action = msg ["action" ]
3133 ext = msg ["ext" ]
34+ cver = 5
3235 if ext not in ["yaml" ,"py" ,"json" ,"conf" ,"js" ,"txt" ,"log" ,"css" ,"jinja" ,"all" ]:
3336 ext = "yaml"
3437
@@ -76,7 +79,7 @@ def read():
7679 finally :
7780 connection .send_result (
7881 msg ["id" ],
79- {'msg' : res + ': ' + fullpath , 'file' : yamlname , 'data' : content , 'ext' : ext }
82+ {'msg' : res + ': ' + fullpath , 'file' : yamlname , 'data' : content , 'ext' : ext , 'cver' : cver }
8083 )
8184
8285 elif (action == 'save' ):
@@ -131,5 +134,5 @@ def dreca():
131134 listyaml = ['list_error.' + ext ]
132135 connection .send_result (
133136 msg ["id" ],
134- {'msg' : str (len (listyaml ))+ ' File(s)' , 'file' : listyaml , 'ext' : ext }
137+ {'msg' : str (len (listyaml ))+ ' File(s)' , 'file' : listyaml , 'ext' : ext , 'cver' : cver }
135138 )
0 commit comments