mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-13 01:54:27 +05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3488d4593a | ||
|
|
76b8988b83 |
@@ -1,5 +1,5 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 1.0.10b7
|
current_version = 1.0.10b8
|
||||||
parse = (?P<major>\d+)(\.(?P<minor>\d+))(\.(?P<patch>\d+))(?P<release>[bf]*)(?P<build>\d*)
|
parse = (?P<major>\d+)(\.(?P<minor>\d+))(\.(?P<patch>\d+))(?P<release>[bf]*)(?P<build>\d*)
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class MegaBinarySensor(BinarySensorEntity, MegaPushEntity):
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
self.mega.binary_sensors.append(self.port)
|
||||||
self._is_on = None
|
self._is_on = None
|
||||||
self._attrs = None
|
self._attrs = None
|
||||||
self._click_task = None
|
self._click_task = None
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class MegaView(HomeAssistantView):
|
|||||||
if ret == 'd' and act:
|
if ret == 'd' and act:
|
||||||
await hub.request(cmd=act.replace(':3', f':{v}'))
|
await hub.request(cmd=act.replace(':3', f':{v}'))
|
||||||
ret = 'd' if hub.force_d else ''
|
ret = 'd' if hub.force_d else ''
|
||||||
else:
|
elif port in hub.binary_sensors:
|
||||||
hub.values[port] = data
|
hub.values[port] = data
|
||||||
for cb in self.callbacks[hub.id][port]:
|
for cb in self.callbacks[hub.id][port]:
|
||||||
cb(data)
|
cb(data)
|
||||||
@@ -147,7 +147,7 @@ class MegaView(HomeAssistantView):
|
|||||||
_LOGGER.debug('response %s', ret)
|
_LOGGER.debug('response %s', ret)
|
||||||
Response(body='' if hub.fake_response else ret, content_type='text/plain')
|
Response(body='' if hub.fake_response else ret, content_type='text/plain')
|
||||||
|
|
||||||
if hub.fake_response and 'value' not in data and 'pt' in data:
|
if hub.fake_response and 'value' not in data and 'pt' in data and port in hub.binary_sensors:
|
||||||
if 'd' in ret:
|
if 'd' in ret:
|
||||||
await hub.request(pt=port, cmd=ret)
|
await hub.request(pt=port, cmd=ret)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ class MegaD:
|
|||||||
hass.data[DOMAIN][CONF_HTTP].protected = protected
|
hass.data[DOMAIN][CONF_HTTP].protected = protected
|
||||||
except Exception:
|
except Exception:
|
||||||
self.lg.exception('while setting allowed hosts')
|
self.lg.exception('while setting allowed hosts')
|
||||||
|
self.binary_sensors = []
|
||||||
|
|
||||||
async def start(self):
|
async def start(self):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -15,5 +15,5 @@
|
|||||||
"@andvikt"
|
"@andvikt"
|
||||||
],
|
],
|
||||||
"issue_tracker": "https://github.com/andvikt/mega_hacs/issues",
|
"issue_tracker": "https://github.com/andvikt/mega_hacs/issues",
|
||||||
"version": "v1.0.10b7"
|
"version": "v1.0.10b8"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user