New API url #27
7 errors
Black found 7 errors
Annotations
Check failure on line 7 in /home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/const.py
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 / 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 / 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 / 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 301 in /home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py
github-actions / Black
/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L289-L301
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 333 in /home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py
github-actions / Black
/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L321-L333
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)
+ self.monthestimate = (
+ self.dailyaverage * daysleft
+ ) + self.revenuemonth
return True
_LOGGER.error(
"Obtaining data from URL %s failed with status code %d",
self.base_url + endpoint,
Check failure on line 796 in /home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py
github-actions / Black
/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L776-L796
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", [])