Skip to content

New API url

New API url #24

GitHub Actions / Black failed Jan 26, 2024 in 0s

8 errors

Black found 8 errors

Annotations

Check failure on line 7 in /home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/const.py

@github-actions github-actions / Black

/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/const.py#L1-L7

 """Docstring."""
+
 SENSOR = "SENSOR"
 
 
 class Device:
     """Docstring."""

Check failure on line 7 in /home/runner/work/pyCheckwatt/pyCheckwatt/setup.py

@github-actions github-actions / Black

/home/runner/work/pyCheckwatt/pyCheckwatt/setup.py#L1-L7

 """Setup script for pyCheckwatt module."""
+
 from setuptools import find_packages, setup
 
 MIN_PY_VERSION = "3.10"
 PACKAGES = find_packages()
 VERSION = "0.1.10"

Check failure on line 7 in /home/runner/work/pyCheckwatt/pyCheckwatt/examples/main.py

@github-actions github-actions / Black

/home/runner/work/pyCheckwatt/pyCheckwatt/examples/main.py#L1-L7

 """Test-module for pyCheckwatt."""
+
 import argparse
 import json
 import os
 
 from dotenv import load_dotenv

Check failure on line 7 in /home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py

@github-actions github-actions / Black

/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L1-L7

 """CheckWatt module."""
+
 from __future__ import annotations
 
 import base64
 import json
 import logging

Check failure on line 19 in /home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py

@github-actions github-actions / Black

/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L9-L19

 
 from aiohttp import ClientError, ClientResponseError, ClientSession
 from dateutil.relativedelta import relativedelta
 
 _LOGGER = logging.getLogger(__name__)
+
 
 class CheckwattManager:
     """CheckWatt manager."""
 
     def __init__(self, username, password, application="pyCheckwatt") -> None:

Check failure on line 299 in /home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py

@github-actions github-actions / Black

/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L288-L299

         try:
             from_date = datetime.now().strftime("%Y-%m-01")
             to_date = datetime.now() + timedelta(days=1)
             to_date = to_date.strftime("%Y-%m-%d")
             lastday_date = datetime.now() + relativedelta(months=1)
-            lastday_date = datetime(year=lastday_date.year, month=lastday_date.month, day=1)
+            lastday_date = datetime(
+                year=lastday_date.year, month=lastday_date.month, day=1
+            )
 
             lastday_date = lastday_date - timedelta(days=1)
 
             lastday = lastday_date.strftime("%d")
 

Check failure on line 332 in /home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py

@github-actions github-actions / Black

/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L318-L332

                     self.revenuemonth += each["NetRevenue"]
                     if each["NetRevenue"] == 0:
                         misseddays += 1
                 dayswithmoney = int(dayssofar) - int(misseddays)
                 if response.status == 200:
-                  self.dailyaverage = self.revenuemonth / int(dayswithmoney)
-                  self.monthestimate = (self.dailyaverage * daysleft) + self.revenuemonth
-                  if response.status == 200:
-                      return True
+                    self.dailyaverage = self.revenuemonth / int(dayswithmoney)
+                    self.monthestimate = (
+                        self.dailyaverage * daysleft
+                    ) + self.revenuemonth
+                    if response.status == 200:
+                        return True
 
                 _LOGGER.error(
                     "Obtaining data from URL %s failed with status code %d",
                     self.base_url + endpoint,
                     response.status,

Check failure on line 794 in /home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py

@github-actions github-actions / Black

/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L774-L794

                 if "NetRevenue" in self.revenue[0]:
                     revenue = self.revenue[0]["NetRevenue"]
 
         return revenue
 
-#    @property
-#    def tomorrow_revenue(self):
-#        """Property for tomorrow's revenue."""
-#        revenue = 0
-#        if self.revenue is not None:
-#            if len(self.revenue) > 1:
-#                if "NetRevenue" in self.revenue[1]:
-#                    revenue = self.revenue[1]["NetRevenue"]
-
-#        return revenue
+    #    @property
+    #    def tomorrow_revenue(self):
+    #        """Property for tomorrow's revenue."""
+    #        revenue = 0
+    #        if self.revenue is not None:
+    #            if len(self.revenue) > 1:
+    #                if "NetRevenue" in self.revenue[1]:
+    #                    revenue = self.revenue[1]["NetRevenue"]
+
+    #        return revenue
 
     def _get_meter_total(self, meter_type):
         """Solar, Charging, Discharging, EDIEL_E17, EDIEL_E18, Soc meter summary."""
         meter_total = 0
         meters = self.power_data.get("Meters", [])