mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 19:57:03 -04:00
Use attribute enums in Zonneplan tests (#193988)
This commit is contained in:
@@ -26,9 +26,8 @@ from pyzonneplan.const import BatteryMode, MarketTimeResolution
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
from homeassistant.components.number import (
|
||||
ATTR_MAX,
|
||||
ATTR_MIN,
|
||||
DOMAIN as NUMBER_DOMAIN,
|
||||
NumberEntityCapabilityAttribute,
|
||||
NumberService,
|
||||
NumberServiceArgument,
|
||||
)
|
||||
@@ -158,8 +157,8 @@ async def test_power_limit_range_fallback(
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert (state := hass.states.get(MAX_CHARGE_POWER_ENTITY_ID))
|
||||
assert state.attributes[ATTR_MIN] == 0
|
||||
assert state.attributes[ATTR_MAX] == 10000
|
||||
assert state.attributes[NumberEntityCapabilityAttribute.MIN] == 0
|
||||
assert state.attributes[NumberEntityCapabilityAttribute.MAX] == 10000
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||
|
||||
@@ -23,8 +23,8 @@ from pyzonneplan.const import BatteryMode
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
from homeassistant.components.select import (
|
||||
ATTR_OPTIONS,
|
||||
DOMAIN as SELECT_DOMAIN,
|
||||
SelectEntityCapabilityAttribute,
|
||||
SelectService,
|
||||
SelectServiceArgument,
|
||||
)
|
||||
@@ -101,7 +101,7 @@ async def test_select_options(
|
||||
|
||||
assert (state := hass.states.get(CONTROL_MODE_ENTITY_ID))
|
||||
assert state.state == control_mode
|
||||
assert state.attributes[ATTR_OPTIONS] == expected_options
|
||||
assert state.attributes[SelectEntityCapabilityAttribute.OPTIONS] == expected_options
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("init_integration")
|
||||
@@ -302,7 +302,7 @@ async def test_select_control_mode_unavailable_at_setup(
|
||||
|
||||
assert (state := hass.states.get(CONTROL_MODE_ENTITY_ID))
|
||||
assert state.state == "self_consumption"
|
||||
assert state.attributes[ATTR_OPTIONS] == [
|
||||
assert state.attributes[SelectEntityCapabilityAttribute.OPTIONS] == [
|
||||
"self_consumption",
|
||||
"home_optimization",
|
||||
"dynamic_charging",
|
||||
|
||||
Reference in New Issue
Block a user