10
10
11
11
async def async_setup (hass , config ):
12
12
websocket_api .async_register_command (hass , websocket_create )
13
- hass .states .async_set (DOMAIN + ".version" , 4 )
14
13
return True
15
14
15
+ async def async_setup_entry (hass , entry ):
16
+ websocket_api .async_register_command (hass , websocket_create )
17
+ return True
16
18
17
19
@websocket_api .require_admin
18
20
@websocket_api .async_response
@@ -29,6 +31,7 @@ async def async_setup(hass, config):
29
31
async def websocket_create (hass , connection , msg ):
30
32
action = msg ["action" ]
31
33
ext = msg ["ext" ]
34
+ cver = 5
32
35
if ext not in ["yaml" ,"py" ,"json" ,"conf" ,"js" ,"txt" ,"log" ,"css" ,"jinja" ,"all" ]:
33
36
ext = "yaml"
34
37
@@ -76,7 +79,7 @@ def read():
76
79
finally :
77
80
connection .send_result (
78
81
msg ["id" ],
79
- {'msg' : res + ': ' + fullpath , 'file' : yamlname , 'data' : content , 'ext' : ext }
82
+ {'msg' : res + ': ' + fullpath , 'file' : yamlname , 'data' : content , 'ext' : ext , 'cver' : cver }
80
83
)
81
84
82
85
elif (action == 'save' ):
@@ -131,5 +134,5 @@ def dreca():
131
134
listyaml = ['list_error.' + ext ]
132
135
connection .send_result (
133
136
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 }
135
138
)
0 commit comments