From df4d4d78148e137a03cf47184db318eaa644e39b Mon Sep 17 00:00:00 2001 From: David Stone Date: Fri, 1 Nov 2024 16:34:17 -0700 Subject: [PATCH] Fix error while loading --- custom_components/openei/const.py | 6 +++--- tests/conftest.py | 2 +- tests/test_sensors.py | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/custom_components/openei/const.py b/custom_components/openei/const.py index 9c67f69..558cf33 100644 --- a/custom_components/openei/const.py +++ b/custom_components/openei/const.py @@ -68,9 +68,9 @@ name="Plan Name", icon="mdi:tag", ), - "current_rate_structure": SensorEntityDescription( - key="current_rate_structure", - name="Current Rate Structure", + "current_energy_rate_structure": SensorEntityDescription( + key="current_energy_rate_structure", + name="Current Energy Rate Structure", icon="mdi:tag", ), "all_rates": SensorEntityDescription( diff --git a/tests/conftest.py b/tests/conftest.py index a98d45a..1d8eaa1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -50,7 +50,7 @@ def mock_api(): '"Fake Utility Co": [{"name": "Fake Plan Name", "label": "randomstring"}]' ) mock_api.return_value.all_rates = [0.24477, 0.007] - mock_api.return_value.current_rate_structure = 4 + mock_api.return_value.current_energy_rate_structure = 4 yield mock_api diff --git a/tests/test_sensors.py b/tests/test_sensors.py index aa7841a..c9c129c 100644 --- a/tests/test_sensors.py +++ b/tests/test_sensors.py @@ -9,7 +9,9 @@ FAKE_MINCHARGE_SENSOR = "sensor.fake_utility_co_minimum_charge" FAKE_CURRENT_RATE_SENSOR = "sensor.fake_utility_co_current_energy_rate" -FAKE_CURRENT_RATE_STRUCTURE_SENSOR = "sensor.fake_utility_co_current_rate_structure" +FAKE_CURRENT_RATE_STRUCTURE_SENSOR = ( + "sensor.fake_utility_co_current_energy_rate_structure" +) pytestmark = pytest.mark.asyncio