Add and use percentage constant (#32094)
* Add and use percentage constant * Fix pylint error and broken test
This commit is contained in:
1 parent
c7f128f286
commit
f1a0ca7cd3
155 files changed
+735
-459
No files matched your search
@@ -14,7 +14,7 @@ from homeassistant.components.notify import (
|
||||
PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_TIMEOUT
|
||||
from homeassistant.const import CONF_HOST, CONF_TIMEOUT, UNIT_PERCENTAGE
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -66,7 +66,14 @@ POSITIONS = {
|
||||
"center": 4,
|
||||
}
|
||||
|
||||
TRANSPARENCIES = {"default": 0, "0%": 1, "25%": 2, "50%": 3, "75%": 4, "100%": 5}
|
||||
TRANSPARENCIES = {
|
||||
"default": 0,
|
||||
f"0{UNIT_PERCENTAGE}": 1,
|
||||
f"25{UNIT_PERCENTAGE}": 2,
|
||||
f"50{UNIT_PERCENTAGE}": 3,
|
||||
f"75{UNIT_PERCENTAGE}": 4,
|
||||
f"100{UNIT_PERCENTAGE}": 5,
|
||||
}
|
||||
|
||||
COLORS = {
|
||||
"grey": "#607d8b",
|
||||
|
||||
Reference in new issue
Block a user