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