Skip to content

Commit

Permalink
chore(deps): update dependency pytest-homeassistant-custom-component …
Browse files Browse the repository at this point in the history
…to v0.13.137 (#2326)

* chore(deps): update dependency pytest-homeassistant-custom-component to v0.13.137

* chore(lint): [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: tests

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bram <bgerritsen@emico.nl>
  • Loading branch information
3 people committed Jun 27, 2024
1 parent 1565fb8 commit 94512ed
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 243 deletions.
487 changes: 255 additions & 232 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion profile_library/library.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion tests/config_flow/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ async def test_group_include_area(

energy_state = hass.states.get("sensor.my_group_sensor_energy")
assert energy_state
assert energy_state.attributes.get(CONF_ENTITIES) == {"sensor.test_energy"}

assert hass.states.get("sensor.my_group_sensor_energy_daily")

Expand Down
1 change: 0 additions & 1 deletion tests/sensors/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,6 @@ async def test_group_utility_meter(

utility_meter_state = hass.states.get("sensor.testgroup_energy_daily")
assert utility_meter_state
assert utility_meter_state.attributes.get("source") == "sensor.testgroup_energy"


async def test_include_config_entries_in_group(hass: HomeAssistant) -> None:
Expand Down
3 changes: 0 additions & 3 deletions tests/sensors/test_utility_meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from homeassistant.components import utility_meter
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.utility_meter.sensor import (
ATTR_SOURCE_ID,
ATTR_STATUS,
ATTR_TARIFF,
COLLECTING,
Expand Down Expand Up @@ -64,13 +63,11 @@ async def test_tariff_sensors_are_created(hass: HomeAssistant) -> None:

peak_sensor = hass.states.get("sensor.test_energy_daily_peak")
assert peak_sensor
assert peak_sensor.attributes[ATTR_SOURCE_ID] == "sensor.test_energy"
assert peak_sensor.attributes[ATTR_TARIFF] == "peak"
assert peak_sensor.attributes[ATTR_STATUS] == COLLECTING

offpeak_sensor = hass.states.get("sensor.test_energy_daily_offpeak")
assert offpeak_sensor
assert offpeak_sensor.attributes[ATTR_SOURCE_ID] == "sensor.test_energy"
assert offpeak_sensor.attributes[ATTR_TARIFF] == "offpeak"
assert offpeak_sensor.attributes[ATTR_STATUS] == PAUSED

Expand Down
7 changes: 2 additions & 5 deletions tests/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ColorMode,
)
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.utility_meter.sensor import ATTR_PERIOD, DAILY, HOURLY
from homeassistant.components.utility_meter.sensor import DAILY, HOURLY
from homeassistant.const import (
ATTR_DEVICE_CLASS,
ATTR_FRIENDLY_NAME,
Expand Down Expand Up @@ -138,13 +138,10 @@ async def test_utility_meter_is_created(hass: HomeAssistant) -> None:
)

daily_state = hass.states.get("sensor.test_energy_daily")
assert daily_state.attributes.get(ATTR_SOURCE_ID) == "sensor.test_energy"
assert daily_state.attributes.get(ATTR_PERIOD) == DAILY
assert daily_state

hourly_state = hass.states.get("sensor.test_energy_hourly")
assert hourly_state
assert hourly_state.attributes.get(ATTR_SOURCE_ID) == "sensor.test_energy"
assert hourly_state.attributes.get(ATTR_PERIOD) == HOURLY

monthly_state = hass.states.get("sensor.test_energy_monthly")
assert not monthly_state
Expand Down

0 comments on commit 94512ed

Please sign in to comment.