From da8e3af567677933c293e17d97c9813ef772a689 Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Fri, 23 Feb 2024 21:22:24 +0100 Subject: [PATCH] Black reformat --- dsmr_consumption/services.py | 30 ++++++++++++------------- dsmr_datalogger/services/datalogger.py | 6 ++--- dsmr_frontend/views/about.py | 6 ++--- dsmr_frontend/views/energy_contracts.py | 6 ++--- dsmr_frontend/views/statistics.py | 6 ++--- dsmr_frontend/views/support.py | 6 ++--- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/dsmr_consumption/services.py b/dsmr_consumption/services.py index b7e3e1a67..5ac6cf337 100644 --- a/dsmr_consumption/services.py +++ b/dsmr_consumption/services.py @@ -485,22 +485,22 @@ def day_consumption(day: datetime.date) -> Dict: consumption["total_cost"] = round_decimal(consumption["total_cost"]) # Current prices as well. - consumption["energy_supplier_price_electricity_delivered_1"] = ( - daily_energy_price.electricity_delivered_1_price - ) - consumption["energy_supplier_price_electricity_delivered_2"] = ( - daily_energy_price.electricity_delivered_2_price - ) - consumption["energy_supplier_price_electricity_returned_1"] = ( - daily_energy_price.electricity_returned_1_price - ) - consumption["energy_supplier_price_electricity_returned_2"] = ( - daily_energy_price.electricity_returned_2_price - ) + consumption[ + "energy_supplier_price_electricity_delivered_1" + ] = daily_energy_price.electricity_delivered_1_price + consumption[ + "energy_supplier_price_electricity_delivered_2" + ] = daily_energy_price.electricity_delivered_2_price + consumption[ + "energy_supplier_price_electricity_returned_1" + ] = daily_energy_price.electricity_returned_1_price + consumption[ + "energy_supplier_price_electricity_returned_2" + ] = daily_energy_price.electricity_returned_2_price consumption["energy_supplier_price_gas"] = daily_energy_price.gas_price - consumption["energy_supplier_price_fixed_daily_cost"] = ( - daily_energy_price.fixed_daily_cost - ) + consumption[ + "energy_supplier_price_fixed_daily_cost" + ] = daily_energy_price.fixed_daily_cost # Any notes of that day. consumption["notes"] = Note.objects.filter(day=day).values_list( diff --git a/dsmr_datalogger/services/datalogger.py b/dsmr_datalogger/services/datalogger.py index 1cafb6bbb..4ddc00c57 100644 --- a/dsmr_datalogger/services/datalogger.py +++ b/dsmr_datalogger/services/datalogger.py @@ -149,9 +149,9 @@ def _map_telegram_to_model(parsed_telegram: Dict, data: str): "dsmr_version" ].startswith("5") - model_fields["extra_device_timestamp"] = ( - calculate_fake_gas_reading_timestamp(now=now, is_dsmr_v5=is_v5) - ) + model_fields[ + "extra_device_timestamp" + ] = calculate_fake_gas_reading_timestamp(now=now, is_dsmr_v5=is_v5) # Fix for rare smart meters with a timestamp in the far future. We should disallow that. discard_after = timezone.now() + timezone.timedelta(hours=24) diff --git a/dsmr_frontend/views/about.py b/dsmr_frontend/views/about.py index 9aa507cf4..a0ff24bed 100644 --- a/dsmr_frontend/views/about.py +++ b/dsmr_frontend/views/about.py @@ -15,9 +15,9 @@ class About(ConfigurableLoginRequiredMixin, TemplateView): def get_context_data(self, **kwargs): context_data = super(About, self).get_context_data(**kwargs) - context_data["monitoring_issues"] = ( - dsmr_backend.services.backend.request_monitoring_status() - ) + context_data[ + "monitoring_issues" + ] = dsmr_backend.services.backend.request_monitoring_status() context_data["frontend_settings"] = FrontendSettings.get_solo() return context_data diff --git a/dsmr_frontend/views/energy_contracts.py b/dsmr_frontend/views/energy_contracts.py index 1efebad07..9e389a849 100644 --- a/dsmr_frontend/views/energy_contracts.py +++ b/dsmr_frontend/views/energy_contracts.py @@ -14,8 +14,8 @@ def get_context_data(self, **kwargs): context_data["capabilities"] = dsmr_backend.services.backend.get_capabilities() context_data["frontend_settings"] = FrontendSettings.get_solo() - context_data["energy_contracts"] = ( - dsmr_consumption.services.summarize_energy_contracts() - ) + context_data[ + "energy_contracts" + ] = dsmr_consumption.services.summarize_energy_contracts() return context_data diff --git a/dsmr_frontend/views/statistics.py b/dsmr_frontend/views/statistics.py index 8c6e5c27c..50b9ccc05 100644 --- a/dsmr_frontend/views/statistics.py +++ b/dsmr_frontend/views/statistics.py @@ -17,9 +17,9 @@ class Statistics(ConfigurableLoginRequiredMixin, TemplateView): def get_context_data(self, **kwargs): context_data = super(Statistics, self).get_context_data(**kwargs) context_data["capabilities"] = dsmr_backend.services.backend.get_capabilities() - context_data["electricity_statistics"] = ( - ElectricityStatistics.get_solo().export() - ) + context_data[ + "electricity_statistics" + ] = ElectricityStatistics.get_solo().export() context_data["frontend_settings"] = FrontendSettings.get_solo() try: diff --git a/dsmr_frontend/views/support.py b/dsmr_frontend/views/support.py index 1498b3c17..c01ad3f39 100644 --- a/dsmr_frontend/views/support.py +++ b/dsmr_frontend/views/support.py @@ -15,9 +15,9 @@ class Support(LoginRequiredMixin, TemplateView): def get_context_data(self, **kwargs): context_data = super(Support, self).get_context_data(**kwargs) - context_data["monitoring_issues"] = ( - dsmr_backend.services.backend.request_monitoring_status() - ) + context_data[ + "monitoring_issues" + ] = dsmr_backend.services.backend.request_monitoring_status() context_data["frontend_settings"] = FrontendSettings.get_solo() return context_data