mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-12 01:24:29 +05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39c4ab0e3b | ||
|
|
a002e48e04 | ||
|
|
dc6bdfc8f4 |
@@ -59,7 +59,7 @@ class BaseMegaEntity(CoordinatorEntity, RestoreEntity):
|
|||||||
"config_entries": [
|
"config_entries": [
|
||||||
self.config_entry,
|
self.config_entry,
|
||||||
],
|
],
|
||||||
"name": f'port {self.port}',
|
"name": f'{self._mega_id} port {self.port}',
|
||||||
"manufacturer": 'ab-log.ru',
|
"manufacturer": 'ab-log.ru',
|
||||||
# "model": self.light.productname,
|
# "model": self.light.productname,
|
||||||
# "sw_version": self.light.swversion,
|
# "sw_version": self.light.swversion,
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ class MegaD:
|
|||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
if mqtt_inputs is None or mqtt_inputs == 'None' or mqtt_inputs is False:
|
if mqtt_inputs is None or mqtt_inputs == 'None' or mqtt_inputs is False:
|
||||||
self.http = hass.data.get(DOMAIN, {}).get(CONF_HTTP)
|
self.http = hass.data.get(DOMAIN, {}).get(CONF_HTTP)
|
||||||
self.http.allowed_hosts |= {host}
|
if not self.http is None:
|
||||||
|
self.http.allowed_hosts |= {host}
|
||||||
else:
|
else:
|
||||||
self.http = None
|
self.http = None
|
||||||
self.update_all = update_all if update_all is not None else True
|
self.update_all = update_all if update_all is not None else True
|
||||||
@@ -371,7 +372,7 @@ class MegaD:
|
|||||||
async for port, pty, m in self.scan_ports(nports):
|
async for port, pty, m in self.scan_ports(nports):
|
||||||
if pty == "0":
|
if pty == "0":
|
||||||
ret['binary_sensor'][port].append({})
|
ret['binary_sensor'][port].append({})
|
||||||
elif pty == "1" and m in ['0', '1', '3']:
|
elif pty == "1" and (m in ['0', '1', '3'] or m is None):
|
||||||
ret['light'][port].append({'dimmer': m == '1'})
|
ret['light'][port].append({'dimmer': m == '1'})
|
||||||
elif pty == '3':
|
elif pty == '3':
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user