mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 04:20:17 +00:00
Add demand window sensor for amberelectric (#121356)
This commit is contained in:
@@ -105,7 +105,7 @@ async def setup_general_and_feed_in(hass: HomeAssistant) -> AsyncGenerator[Mock]
|
||||
|
||||
async def test_general_price_sensor(hass: HomeAssistant, setup_general: Mock) -> None:
|
||||
"""Test the General Price sensor."""
|
||||
assert len(hass.states.async_all()) == 5
|
||||
assert len(hass.states.async_all()) == 6
|
||||
price = hass.states.get("sensor.mock_title_general_price")
|
||||
assert price
|
||||
assert price.state == "0.08"
|
||||
@@ -143,7 +143,7 @@ async def test_general_price_sensor(hass: HomeAssistant, setup_general: Mock) ->
|
||||
@pytest.mark.usefixtures("setup_general_and_controlled_load")
|
||||
async def test_general_and_controlled_load_price_sensor(hass: HomeAssistant) -> None:
|
||||
"""Test the Controlled Price sensor."""
|
||||
assert len(hass.states.async_all()) == 8
|
||||
assert len(hass.states.async_all()) == 9
|
||||
price = hass.states.get("sensor.mock_title_controlled_load_price")
|
||||
assert price
|
||||
assert price.state == "0.08"
|
||||
@@ -165,7 +165,7 @@ async def test_general_and_controlled_load_price_sensor(hass: HomeAssistant) ->
|
||||
@pytest.mark.usefixtures("setup_general_and_feed_in")
|
||||
async def test_general_and_feed_in_price_sensor(hass: HomeAssistant) -> None:
|
||||
"""Test the Feed In sensor."""
|
||||
assert len(hass.states.async_all()) == 8
|
||||
assert len(hass.states.async_all()) == 9
|
||||
price = hass.states.get("sensor.mock_title_feed_in_price")
|
||||
assert price
|
||||
assert price.state == "-0.08"
|
||||
@@ -188,7 +188,7 @@ async def test_general_forecast_sensor(
|
||||
hass: HomeAssistant, setup_general: Mock
|
||||
) -> None:
|
||||
"""Test the General Forecast sensor."""
|
||||
assert len(hass.states.async_all()) == 5
|
||||
assert len(hass.states.async_all()) == 6
|
||||
price = hass.states.get("sensor.mock_title_general_forecast")
|
||||
assert price
|
||||
assert price.state == "0.09"
|
||||
@@ -230,7 +230,7 @@ async def test_general_forecast_sensor(
|
||||
@pytest.mark.usefixtures("setup_general_and_controlled_load")
|
||||
async def test_controlled_load_forecast_sensor(hass: HomeAssistant) -> None:
|
||||
"""Test the Controlled Load Forecast sensor."""
|
||||
assert len(hass.states.async_all()) == 8
|
||||
assert len(hass.states.async_all()) == 9
|
||||
price = hass.states.get("sensor.mock_title_controlled_load_forecast")
|
||||
assert price
|
||||
assert price.state == "0.09"
|
||||
@@ -254,7 +254,7 @@ async def test_controlled_load_forecast_sensor(hass: HomeAssistant) -> None:
|
||||
@pytest.mark.usefixtures("setup_general_and_feed_in")
|
||||
async def test_feed_in_forecast_sensor(hass: HomeAssistant) -> None:
|
||||
"""Test the Feed In Forecast sensor."""
|
||||
assert len(hass.states.async_all()) == 8
|
||||
assert len(hass.states.async_all()) == 9
|
||||
price = hass.states.get("sensor.mock_title_feed_in_forecast")
|
||||
assert price
|
||||
assert price.state == "-0.09"
|
||||
@@ -278,7 +278,7 @@ async def test_feed_in_forecast_sensor(hass: HomeAssistant) -> None:
|
||||
@pytest.mark.usefixtures("setup_general")
|
||||
def test_renewable_sensor(hass: HomeAssistant) -> None:
|
||||
"""Testing the creation of the Amber renewables sensor."""
|
||||
assert len(hass.states.async_all()) == 5
|
||||
assert len(hass.states.async_all()) == 6
|
||||
sensor = hass.states.get("sensor.mock_title_renewables")
|
||||
assert sensor
|
||||
assert sensor.state == "51"
|
||||
@@ -287,7 +287,7 @@ def test_renewable_sensor(hass: HomeAssistant) -> None:
|
||||
@pytest.mark.usefixtures("setup_general")
|
||||
def test_general_price_descriptor_descriptor_sensor(hass: HomeAssistant) -> None:
|
||||
"""Test the General Price Descriptor sensor."""
|
||||
assert len(hass.states.async_all()) == 5
|
||||
assert len(hass.states.async_all()) == 6
|
||||
price = hass.states.get("sensor.mock_title_general_price_descriptor")
|
||||
assert price
|
||||
assert price.state == "extremely_low"
|
||||
@@ -298,7 +298,7 @@ def test_general_and_controlled_load_price_descriptor_sensor(
|
||||
hass: HomeAssistant,
|
||||
) -> None:
|
||||
"""Test the Controlled Price Descriptor sensor."""
|
||||
assert len(hass.states.async_all()) == 8
|
||||
assert len(hass.states.async_all()) == 9
|
||||
price = hass.states.get("sensor.mock_title_controlled_load_price_descriptor")
|
||||
assert price
|
||||
assert price.state == "extremely_low"
|
||||
@@ -307,7 +307,7 @@ def test_general_and_controlled_load_price_descriptor_sensor(
|
||||
@pytest.mark.usefixtures("setup_general_and_feed_in")
|
||||
def test_general_and_feed_in_price_descriptor_sensor(hass: HomeAssistant) -> None:
|
||||
"""Test the Feed In Price Descriptor sensor."""
|
||||
assert len(hass.states.async_all()) == 8
|
||||
assert len(hass.states.async_all()) == 9
|
||||
price = hass.states.get("sensor.mock_title_feed_in_price_descriptor")
|
||||
assert price
|
||||
assert price.state == "extremely_low"
|
||||
|
||||
Reference in New Issue
Block a user