Skip to content

Commit

Permalink
Linting...
Browse files Browse the repository at this point in the history
  • Loading branch information
CJNE committed Oct 16, 2024
1 parent 30018da commit 696fb55
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 15 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ Currently supported features:
- Enable/Disable charging from the grid
- Set charge target (in Wh)


## CLI examples:

```bash
Expand Down
10 changes: 7 additions & 3 deletions pymyenergi/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import sys
from getpass import getpass

from pymyenergi.client import device_factory
from pymyenergi.client import MyenergiClient
from pymyenergi.client import device_factory
from pymyenergi.connection import Connection
from pymyenergi.eddi import BOOST_TARGETS
from pymyenergi.eddi import EDDI_MODES
Expand Down Expand Up @@ -36,7 +36,9 @@ async def main(args):
username = args.username or input("Please enter your hub serial number: ")
password = args.password or getpass(prompt="Password (apikey): ")
if not args.skip_oauth:
app_email = args.app_email or input("App email (enter to skip; only needed for libbi): ")
app_email = args.app_email or input(
"App email (enter to skip; only needed for libbi): "
)
if app_email:
app_password = args.app_password or getpass(prompt="App password: ")
else:
Expand Down Expand Up @@ -200,7 +202,9 @@ def cli():
dest="app_email",
default=config.get("hub", "app_email").strip('"'),
)
parser.add_argument("--skip-oauth", dest="skip_oauth", action="store_true", default=False)
parser.add_argument(
"--skip-oauth", dest="skip_oauth", action="store_true", default=False
)
parser.add_argument("-d", "--debug", dest="debug", action="store_true")
parser.add_argument("-j", "--json", dest="json", action="store_true", default=False)
parser.add_argument("--version", dest="version", action="store_true", default=False)
Expand Down
20 changes: 9 additions & 11 deletions pymyenergi/zappi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,22 @@
"U": "",
}
PHASES_STATES = {
"SINGLE_PHASE" : "1",
"THREE_PHASE" : "3",
"AUTO" : "auto",
"SINGLE_PHASE": "1",
"THREE_PHASE": "3",
"AUTO": "auto",
}
PHASES_STRINGS = {
"1" : "SINGLE_PHASE",
"3" : "THREE_PHASE",
"auto" : "AUTO",
"1": "SINGLE_PHASE",
"3": "THREE_PHASE",
"auto": "AUTO",
}
PHASE_SETTING = {
"1" : 0,
"3" : 1,
"auto" : 2,
"1": 0,
"3": 1,
"auto": 2,
}



class Zappi(BaseDevice):
"""Zappi Client for myenergi API."""

Expand Down Expand Up @@ -366,7 +365,6 @@ async def set_phase_setting(self, phase):
self._data["num_phases"] = PHASES_STRINGS.get(phase)
return True


async def start_boost(self, amount):
"""Start boost"""
if self.charge_mode not in ["Eco", "Eco+"]:
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Global fixtures"""

import json
from unittest.mock import patch

Expand Down
1 change: 1 addition & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from pymyenergi.client import MyenergiClient
from pymyenergi.eddi import Eddi
from pymyenergi.harvi import Harvi
Expand Down
1 change: 1 addition & 0 deletions tests/test_eddi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest.mock import AsyncMock

import pytest

from pymyenergi.eddi import Eddi

pytestmark = pytest.mark.asyncio
Expand Down
1 change: 1 addition & 0 deletions tests/test_harvi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from pymyenergi.harvi import Harvi

pytestmark = pytest.mark.asyncio
Expand Down
1 change: 1 addition & 0 deletions tests/test_libbi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from pymyenergi.libbi import Libbi

pytestmark = pytest.mark.asyncio
Expand Down
1 change: 1 addition & 0 deletions tests/test_zappi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from pymyenergi.zappi import Zappi

pytestmark = pytest.mark.asyncio
Expand Down

0 comments on commit 696fb55

Please sign in to comment.