Skip to content

Commit 843e034

Browse files
authored
Update __init__.py
1 parent b1371a1 commit 843e034

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

custom_components/config_editor/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010

1111
async 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):
2931
async 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

Comments
 (0)