Skip to content

New API url

New API url #24

Triggered via pull request January 26, 2024 22:05
@flopp999flopp999
synchronize #30
newAPiURl
Status Success
Total duration 21s
Artifacts

linting.yml

on: pull_request
Run linting
12s
Run linting
Fit to window
Zoom out
Zoom in

Annotations

15 errors and 2 warnings
pycheckwatt/__init__.py#L15
Expected 2 blank lines, found 1 (E302)
pycheckwatt/__init__.py#L293
Line too long (92 > 88 characters) (E501)
/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/const.py#L1
"""Docstring.""" + SENSOR = "SENSOR" class Device: """Docstring."""
pycheckwatt/__init__.py#L323
Indentation is not a multiple of 4 (E111)
/home/runner/work/pyCheckwatt/pyCheckwatt/setup.py#L1
"""Setup script for pyCheckwatt module.""" + from setuptools import find_packages, setup MIN_PY_VERSION = "3.10" PACKAGES = find_packages() VERSION = "0.1.10"
pycheckwatt/__init__.py#L324
Indentation is not a multiple of 4 (E111)
/home/runner/work/pyCheckwatt/pyCheckwatt/examples/main.py#L1
"""Test-module for pyCheckwatt.""" + import argparse import json import os from dotenv import load_dotenv
pycheckwatt/__init__.py#L324
Line too long (89 > 88 characters) (E501)
/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L1
"""CheckWatt module.""" + from __future__ import annotations import base64 import json import logging
/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L9
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:
pycheckwatt/__init__.py#L325
Indentation is not a multiple of 4 (E111)
pycheckwatt/__init__.py#L326
Indentation is not a multiple of 4 (E111)
/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L288
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")
/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L318
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,
/home/runner/work/pyCheckwatt/pyCheckwatt/pycheckwatt/__init__.py#L774
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", [])
Run linting
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Run linting
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/setup-python@v4, wearerequired/lint-action@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.