From 1d7e50f69e56135a4c818c0b89fd307b07d0c698 Mon Sep 17 00:00:00 2001 From: faanskit Date: Sun, 28 Jan 2024 06:58:58 +0000 Subject: [PATCH] Removed tomorrow property --- custom_components/checkwatt/__init__.py | 4 ---- custom_components/checkwatt/const.py | 1 - custom_components/checkwatt/sensor.py | 18 ------------------ custom_components/checkwatt/strings.json | 3 --- .../checkwatt/translations/en.json | 3 --- .../checkwatt/translations/sv.json | 3 --- 6 files changed, 32 deletions(-) diff --git a/custom_components/checkwatt/__init__.py b/custom_components/checkwatt/__init__.py index 74454cd..1e8bebe 100644 --- a/custom_components/checkwatt/__init__.py +++ b/custom_components/checkwatt/__init__.py @@ -59,7 +59,6 @@ class CheckwattResp(TypedDict): discharge_peak_dc: float today_net_revenue: float - tomorrow_net_revenue: float monthly_net_revenue: float annual_net_revenue: float month_estimate: float @@ -158,7 +157,6 @@ def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None: self._id = None self.update_all = 0 self.fcrd_today_net_revenue = None - self.fcrd_tomorrow_net_revenue = None self.fcrd_month_net_revenue = None self.fcrd_month_net_estimate = None self.fcrd_daily_net_average = None @@ -216,7 +214,6 @@ async def _async_update_data(self) -> CheckwattResp: # noqa: C901 raise UpdateFailed("Unknown error get_revenue_year") self.fcrd_today_net_revenue = cw_inst.fcrd_today_net_revenue - self.fcrd_tomorrow_net_revenue = cw_inst.fcrd_tomorrow_net_revenue self.fcrd_month_net_revenue = cw_inst.fcrd_month_net_revenue self.fcrd_month_net_estimate = cw_inst.fcrd_month_net_estimate self.fcrd_daily_net_average = cw_inst.fcrd_daily_net_average @@ -291,7 +288,6 @@ async def _async_update_data(self) -> CheckwattResp: # noqa: C901 # Use self stored variant of revenue parameters as they are not always fetched if self.fcrd_today_net_revenue is not None: resp["today_net_revenue"] = self.fcrd_today_net_revenue - resp["tomorrow_net_revenue"] = self.fcrd_tomorrow_net_revenue if self.fcrd_month_net_revenue is not None: resp["monthly_net_revenue"] = self.fcrd_month_net_revenue resp["month_estimate"] = self.fcrd_month_net_estimate diff --git a/custom_components/checkwatt/const.py b/custom_components/checkwatt/const.py index 7a50588..f0859fc 100644 --- a/custom_components/checkwatt/const.py +++ b/custom_components/checkwatt/const.py @@ -42,7 +42,6 @@ C_NEXT_UPDATE_TIME = "next_update" C_PRICE_ZONE = "price_zone" C_SOLAR_POWER = "solar_power" -C_TOMORROW_NET = "tomorrow_net_income" C_UPDATE_TIME = "last_update" C_VAT = "vat" C_ZIP = "zip_code" diff --git a/custom_components/checkwatt/sensor.py b/custom_components/checkwatt/sensor.py index 011afa8..e9dc049 100644 --- a/custom_components/checkwatt/sensor.py +++ b/custom_components/checkwatt/sensor.py @@ -41,7 +41,6 @@ C_NEXT_UPDATE_TIME, C_PRICE_ZONE, C_SOLAR_POWER, - C_TOMORROW_NET, C_UPDATE_TIME, C_VAT, C_ZIP, @@ -281,14 +280,6 @@ def __init__( self._attr_extra_state_attributes.update( {C_ENERGY_PROVIDER: self._coordinator.data["energy_provider"]} ) - if "tomorrow_net_revenue" in self._coordinator.data: - self._attr_extra_state_attributes.update( - { - C_TOMORROW_NET: round( - self._coordinator.data["tomorrow_net_revenue"], 2 - ) - } - ) if "update_time" in self._coordinator.data: self._attr_extra_state_attributes.update( {C_UPDATE_TIME: self._coordinator.data["update_time"]} @@ -307,15 +298,6 @@ async def async_update(self) -> None: @callback def _handle_coordinator_update(self) -> None: """Get the latest data and updates the states.""" - # Update the native value - if "tomorrow_net_revenue" in self._coordinator.data: - self._attr_extra_state_attributes.update( - { - C_TOMORROW_NET: round( - self._coordinator.data["tomorrow_net_revenue"], 2 - ) - } - ) if "update_time" in self._coordinator.data: self._attr_extra_state_attributes.update( {C_UPDATE_TIME: self._coordinator.data["update_time"]} diff --git a/custom_components/checkwatt/strings.json b/custom_components/checkwatt/strings.json index a26b73c..667906b 100644 --- a/custom_components/checkwatt/strings.json +++ b/custom_components/checkwatt/strings.json @@ -56,9 +56,6 @@ "energy_provider": { "name": "Energy Provider" }, - "tomorrow_net_income": { - "name": "Tomorrow Net Income" - }, "last_update": { "name": "Last update" }, diff --git a/custom_components/checkwatt/translations/en.json b/custom_components/checkwatt/translations/en.json index e1687ae..5a651cd 100644 --- a/custom_components/checkwatt/translations/en.json +++ b/custom_components/checkwatt/translations/en.json @@ -56,9 +56,6 @@ "energy_provider": { "name": "Energy Provider" }, - "tomorrow_net_income": { - "name": "Tomorrow Net Income" - }, "last_update": { "name": "Last update" }, diff --git a/custom_components/checkwatt/translations/sv.json b/custom_components/checkwatt/translations/sv.json index f35ba8a..e47b6c6 100644 --- a/custom_components/checkwatt/translations/sv.json +++ b/custom_components/checkwatt/translations/sv.json @@ -56,9 +56,6 @@ "energy_provider": { "name": "Elhandelsbolag" }, - "tomorrow_net_income": { - "name": "Morgondagens Nettointäkt" - }, "last_update": { "name": "Senaste uppdateringen" },