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
@@ -4,7 +4,7 @@ import pytest
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.sensor import DOMAIN
|
||||
from homeassistant.components.sensor.device_condition import ENTITY_CONDITIONS
|
||||
from homeassistant.const import CONF_PLATFORM, STATE_UNKNOWN
|
||||
from homeassistant.const import CONF_PLATFORM, STATE_UNKNOWN, UNIT_PERCENTAGE
|
||||
from homeassistant.helpers import device_registry
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
@@ -97,13 +97,13 @@ async def test_get_condition_capabilities(hass, device_reg, entity_reg):
|
||||
expected_capabilities = {
|
||||
"extra_fields": [
|
||||
{
|
||||
"description": {"suffix": "%"},
|
||||
"description": {"suffix": UNIT_PERCENTAGE},
|
||||
"name": "above",
|
||||
"optional": True,
|
||||
"type": "float",
|
||||
},
|
||||
{
|
||||
"description": {"suffix": "%"},
|
||||
"description": {"suffix": UNIT_PERCENTAGE},
|
||||
"name": "below",
|
||||
"optional": True,
|
||||
"type": "float",
|
||||
|
||||
@@ -6,7 +6,7 @@ import pytest
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.sensor import DOMAIN
|
||||
from homeassistant.components.sensor.device_trigger import ENTITY_TRIGGERS
|
||||
from homeassistant.const import CONF_PLATFORM, STATE_UNKNOWN
|
||||
from homeassistant.const import CONF_PLATFORM, STATE_UNKNOWN, UNIT_PERCENTAGE
|
||||
from homeassistant.helpers import device_registry
|
||||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
@@ -102,13 +102,13 @@ async def test_get_trigger_capabilities(hass, device_reg, entity_reg):
|
||||
expected_capabilities = {
|
||||
"extra_fields": [
|
||||
{
|
||||
"description": {"suffix": "%"},
|
||||
"description": {"suffix": UNIT_PERCENTAGE},
|
||||
"name": "above",
|
||||
"optional": True,
|
||||
"type": "float",
|
||||
},
|
||||
{
|
||||
"description": {"suffix": "%"},
|
||||
"description": {"suffix": UNIT_PERCENTAGE},
|
||||
"name": "below",
|
||||
"optional": True,
|
||||
"type": "float",
|
||||
|
||||
Reference in new issue
Block a user