Compare commits

..

4 Commits

Author SHA1 Message Date
andvikt
5617e7afa5 Bump version: 1.0.10b9 → 1.0.11b0 2021-10-28 20:01:49 +03:00
andvikt
bcdec2d793 . 2021-10-28 20:01:18 +03:00
Викторов Андрей Германович
c4aae6b3ec Bump version: 1.0.10b8 → 1.0.10b9 2021-10-28 16:41:39 +03:00
Викторов Андрей Германович
58d243dcc3 новы способ адресации кастомизаций 2021-10-28 16:41:36 +03:00
4 changed files with 8 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
[bumpversion] [bumpversion]
current_version = 1.0.10b8 current_version = 1.0.11b0
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

View File

@@ -104,6 +104,10 @@ CONFIG_SCHEMA = vol.Schema(
{ {
DOMAIN: { DOMAIN: {
vol.Optional(CONF_ALLOW_HOSTS): [str], vol.Optional(CONF_ALLOW_HOSTS): [str],
vol.Optional('entities'): vol.Any(
CUSTOMIZE_PORT,
CUSTOMIZE_DS2413
),
vol.Optional(vol.Any(str, int), description='id меги из веб-интерфейса'): { vol.Optional(vol.Any(str, int), description='id меги из веб-интерфейса'): {
vol.Optional(CONF_FORCE_D, description='Принудительно слать d после срабатывания входа', default=False): bool, vol.Optional(CONF_FORCE_D, description='Принудительно слать d после срабатывания входа', default=False): bool,
vol.Optional( vol.Optional(

View File

@@ -129,12 +129,14 @@ class BaseMegaEntity(CoordinatorEntity, RestoreEntity):
if self.hass is None: if self.hass is None:
return {} return {}
if self._customize is None: if self._customize is None:
c_entity_id = self.hass.data.get(DOMAIN, {}).get(self.entity_id, {})
c = self.hass.data.get(DOMAIN, {}).get(CONF_CUSTOM) or {} c = self.hass.data.get(DOMAIN, {}).get(CONF_CUSTOM) or {}
c = c.get(self._mega_id) or {} c = c.get(self._mega_id) or {}
c = c.get(self.port) or {} c = c.get(self.port) or {}
if self.addr is not None and self.index is not None and isinstance(c, dict): if self.addr is not None and self.index is not None and isinstance(c, dict):
idx = self.addr.lower() + f'_a' if self.index == 0 else '_b' idx = self.addr.lower() + f'_a' if self.index == 0 else '_b'
c = c.get(idx, {}) c = c.get(idx, {})
c.update(c_entity_id)
self._customize = c self._customize = c
return self._customize return self._customize

View File

@@ -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.10b8" "version": "v1.0.11b0"
} }