mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-12 01:24:29 +05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80e43888b9 | ||
|
|
ba41cbb100 | ||
|
|
0b5b9744ba | ||
|
|
9746311f38 |
@@ -56,8 +56,8 @@ CONFIG_SCHEMA = vol.Schema(
|
||||
vol.Optional(
|
||||
CONF_DEF_RESPONSE,
|
||||
description='Ответ по умолчанию',
|
||||
default=''
|
||||
): cv.template,
|
||||
default=None
|
||||
): vol.Any(cv.template, None),
|
||||
vol.Optional(int, description='номер порта'): vol.Any(
|
||||
CUSTOMIZE_PORT,
|
||||
CUSTOMIZE_DS2413,
|
||||
|
||||
@@ -57,7 +57,7 @@ async def validate_input(hass: core.HomeAssistant, data):
|
||||
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
"""Handle a config flow for mega."""
|
||||
|
||||
VERSION = 9
|
||||
VERSION = 10
|
||||
CONNECTION_CLASS = config_entries.CONN_CLASS_ASSUMED
|
||||
|
||||
async def async_step_user(self, user_input=None):
|
||||
|
||||
@@ -480,10 +480,15 @@ class MegaD:
|
||||
elif pty in ('3', '2', '4'):
|
||||
try:
|
||||
http_cmd = 'get'
|
||||
values = await self.get_port(port, force_http=True)
|
||||
if values is None or (isinstance(values, dict) and str(values.get('value')) in ('', 'None')):
|
||||
if m == '5' and pty == '3':
|
||||
# 1-wire bus
|
||||
values = await self.get_port(port, force_http=True, http_cmd='list')
|
||||
http_cmd = 'list'
|
||||
else:
|
||||
values = await self.get_port(port, force_http=True)
|
||||
if values is None or (isinstance(values, dict) and str(values.get('value')) in ('', 'None')):
|
||||
values = await self.get_port(port, force_http=True, http_cmd='list')
|
||||
http_cmd = 'list'
|
||||
except asyncio.TimeoutError:
|
||||
self.lg.warning(f'timout on port {port}')
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user