Compare commits

..

4 Commits

Author SHA1 Message Date
andvikt
28bf4393f0 Bump version: 1.0.10b19 → 1.0.10b20 2021-10-29 19:53:01 +03:00
andvikt
5ecb246eff fix brightness 2021-10-29 19:52:10 +03:00
Викторов Андрей Германович
3ee464a896 Bump version: 1.0.10b18 → 1.0.10b19 2021-10-29 15:26:28 +03:00
Викторов Андрей Германович
6368fd7cfc add fill_na 2021-10-29 15:26:21 +03:00
4 changed files with 10 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.10b18
current_version = 1.0.10b20
parse = (?P<major>\d+)(\.(?P<minor>\d+))(\.(?P<patch>\d+))(?P<release>[bf]*)(?P<build>\d*)
commit = True
tag = True

View File

@@ -130,7 +130,6 @@ class BaseMegaEntity(CoordinatorEntity, RestoreEntity):
if self.hass is None or self.entity_id is None:
return {}
if self._customize is None:
c_entity_id = self.hass.data.get(DOMAIN, {}).get(CONF_CUSTOM).get('entities', {}).get(self.entity_id, {})
self.lg.debug(
'customize %s with %s', self.entity_id, c_entity_id
@@ -431,6 +430,8 @@ class MegaOutPort(MegaPushEntity):
))
def _calc_brightness(self, brightness):
if brightness is None:
brightness = 0
pct = brightness / 255
pct = max((0, pct))
pct = min((pct, 1))
@@ -440,6 +441,8 @@ class MegaOutPort(MegaPushEntity):
return brightness
def _cal_reverse_brightness(self, brightness):
if brightness is None:
brightness = 0
l, h = self.range
d = h - l
pct = (brightness - l) / d

View File

@@ -15,5 +15,5 @@
"@andvikt"
],
"issue_tracker": "https://github.com/andvikt/mega_hacs/issues",
"version": "v1.0.10b18"
"version": "v1.0.10b20"
}

View File

@@ -324,7 +324,10 @@ class Mega1WSensor(FilterBadValues):
n = super().name
c = self.customize.get(CONF_NAME, {})
if isinstance(c, dict):
c = c.get(self.key)
try:
c = c.get(self.key)
except:
pass
return c or n