mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-12 01:24:29 +05:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce589c97b9 | ||
|
|
22a6f8f444 | ||
|
|
9a53de1d5d | ||
|
|
bd8b07dd90 | ||
|
|
d9b6ba3a50 |
@@ -63,7 +63,7 @@ async def validate_input(hass: core.HomeAssistant, data):
|
||||
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
"""Handle a config flow for mega."""
|
||||
|
||||
VERSION = 16
|
||||
VERSION = 17
|
||||
CONNECTION_CLASS = config_entries.CONN_CLASS_ASSUMED
|
||||
|
||||
async def async_step_user(self, user_input=None):
|
||||
|
||||
@@ -100,11 +100,11 @@ class MegaView(HomeAssistantView):
|
||||
ret = 'd' if hub.force_d else ''
|
||||
if port is not None:
|
||||
if is_ext(data):
|
||||
ret = '' # пока ответ всегда пустой, неясно какая будет реакция на непустой ответ
|
||||
# ret = '' # пока ответ всегда пустой, неясно какая будет реакция на непустой ответ
|
||||
if port in hub.extenders:
|
||||
pt_orig = port
|
||||
else:
|
||||
pt_orig = hub.ext_in.get(port)
|
||||
pt_orig = hub.ext_in.get(port, hub.ext_in.get(str(port)))
|
||||
if pt_orig is None:
|
||||
hub.lg.warning(f'can not find extender for int port {port}, '
|
||||
f'have ext_int: {hub.ext_in}, ext: {hub.extenders}')
|
||||
@@ -126,6 +126,8 @@ class MegaView(HomeAssistantView):
|
||||
if template is not None:
|
||||
template.hass = hass
|
||||
ret = template.async_render(_data)
|
||||
hub.lg.debug(f'response={ret}, template={template}')
|
||||
ret = ret.replace(':3', f':{v}')
|
||||
if ret == 'd' and act:
|
||||
await hub.request(cmd=act)
|
||||
ret = 'd' if hub.force_d else ''
|
||||
|
||||
Reference in New Issue
Block a user