Skip to content

Commit 9e30ae3

Browse files
authored
Merge pull request #23 from junkfix/junkfix-patch-1
UI setup and version hiding
2 parents b1371a1 + 7c64503 commit 9e30ae3

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
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
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from homeassistant.helpers import config_entry_flow
2+
3+
config_entry_flow.register_discovery_flow(
4+
"config_editor", "Config Editor", lambda hass: True
5+
)

custom_components/config_editor/manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"domain": "config_editor",
33
"name": "Config Editor",
44
"codeowners": ["@junkfix"],
5+
"config_flow": true,
56
"documentation": "https://github.com/junkfix/config-editor-card",
67
"iot_class": "local_polling",
78
"issue_tracker": "https://github.com/junkfix/config-editor/issues",
8-
"version": "4.4.2"
9+
"version": "5.0.0"
910
}

0 commit comments

Comments
 (0)