Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed tomorrow property #54

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions custom_components/checkwatt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion custom_components/checkwatt/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 0 additions & 18 deletions custom_components/checkwatt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
C_NEXT_UPDATE_TIME,
C_PRICE_ZONE,
C_SOLAR_POWER,
C_TOMORROW_NET,
C_UPDATE_TIME,
C_VAT,
C_ZIP,
Expand Down Expand Up @@ -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"]}
Expand All @@ -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"]}
Expand Down
3 changes: 0 additions & 3 deletions custom_components/checkwatt/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
"energy_provider": {
"name": "Energy Provider"
},
"tomorrow_net_income": {
"name": "Tomorrow Net Income"
},
"last_update": {
"name": "Last update"
},
Expand Down
3 changes: 0 additions & 3 deletions custom_components/checkwatt/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
"energy_provider": {
"name": "Energy Provider"
},
"tomorrow_net_income": {
"name": "Tomorrow Net Income"
},
"last_update": {
"name": "Last update"
},
Expand Down
3 changes: 0 additions & 3 deletions custom_components/checkwatt/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
"energy_provider": {
"name": "Elhandelsbolag"
},
"tomorrow_net_income": {
"name": "Morgondagens Nettointäkt"
},
"last_update": {
"name": "Senaste uppdateringen"
},
Expand Down
Loading