Compare commits

..

2 Commits

Author SHA1 Message Date
Andrey
4af40c29a7 fix d 2021-02-18 14:10:04 +03:00
Andrey
75a41c9667 fix i2c 2021-02-18 12:36:43 +03:00
4 changed files with 10 additions and 4 deletions

View File

@@ -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 = 6
VERSION = 7
CONNECTION_CLASS = config_entries.CONN_CLASS_ASSUMED
async def async_step_user(self, user_input=None):

View File

@@ -80,11 +80,11 @@ class MegaView(HomeAssistantView):
_LOGGER.debug('response %s', ret)
Response(body='', content_type='text/plain', headers={'Server': 's', 'Date': 'n'})
if ret:
await hub.request(cmd=ret)
await hub.request(pt=port, cmd=ret)
return ret
async def later_update(self, hub):
_LOGGER.debug('force update')
await asyncio.sleep(1)
_LOGGER.debug('force update')
await hub.updater.async_refresh()

View File

@@ -260,7 +260,10 @@ class MegaD:
if 'busy' in ret:
return None
if ':' in ret:
ret = ret.split(';')
if ';' in ret:
ret = ret.split(';')
elif '/' in ret:
ret = ret.split('/')
ret = {'value': dict([
x.split(':') for x in ret if x.count(':') == 1
])}

View File

@@ -12,6 +12,9 @@
Обновление прошивки MegaD можно делать прямо из HA с помощью [аддона](https://github.com/andvikt/mega_addon.git)
Подробная документация по [ссылке](https://github.com/andvikt/mega_hacs/wiki)
Предложения по доработкам просьба писать в [discussions](https://github.com/andvikt/mega_hacs/discussions), о проблемах
создавать [issue](https://github.com/andvikt/mega_hacs/issues/new/choose)
## Основные особенности:
- Настройка в веб-интерфейсе + yaml
- Все порты автоматически добавляются как устройства (для обычных релейных выходов создается