Skip to content

Commit

Permalink
Run formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 27, 2024
1 parent 7d50430 commit 93d9597
Show file tree
Hide file tree
Showing 30 changed files with 62 additions and 21 deletions.
32 changes: 19 additions & 13 deletions pyworxcloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""pyWorxCloud definition."""

# pylint: disable=undefined-loop-variable
# pylint: disable=line-too-long
# pylint: disable=too-many-lines
Expand Down Expand Up @@ -64,10 +65,9 @@ def __init__(
self,
username: str,
password: str,
cloud: CloudType.WORX
| CloudType.KRESS
| CloudType.LANDXCAPE
| str = CloudType.WORX,
cloud: (
CloudType.WORX | CloudType.KRESS | CloudType.LANDXCAPE | str
) = CloudType.WORX,
verify_ssl: bool = True,
tz: str | None = None, # pylint: disable=invalid-name
) -> None:
Expand Down Expand Up @@ -539,9 +539,11 @@ def _decode_data(self, device: DeviceHandler) -> None:

for day in range(
0,
len(data["cfg"]["sc"]["d"])
if device.protocol == 0
else len(data["cfg"]["sc"]["slots"]),
(
len(data["cfg"]["sc"]["d"])
if device.protocol == 0
else len(data["cfg"]["sc"]["slots"])
),
):
dayOfWeek = ( # pylint: disable=invalid-name
day
Expand Down Expand Up @@ -656,9 +658,11 @@ def _decode_data(self, device: DeviceHandler) -> None:
] = end_time.time().strftime("%H:%M")

device.schedules.update_progress_and_next(
tz=self._tz
if not isinstance(self._tz, type(None))
else device.time_zone
tz=(
self._tz
if not isinstance(self._tz, type(None))
else device.time_zone
)
)
# except TypeError:
# invalid_data = True
Expand Down Expand Up @@ -871,9 +875,11 @@ def set_partymode(self, serial_number: str, state: bool) -> None:
self.mqtt.publish(
serial_number if mower["protocol"] == 0 else mower["uuid"],
mower["mqtt_topics"]["command_in"],
{"sc": {"m": 2, "distm": 0}}
if state
else {"sc": {"m": 1, "distm": 0}},
(
{"sc": {"m": 2, "distm": 0}}
if state
else {"sc": {"m": 1, "distm": 0}}
),
mower["protocol"],
)
else:
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Landroid Cloud API implementation"""

# pylint: disable=unnecessary-lambda
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/clouds.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Supported cloud endpoints."""

from __future__ import annotations

WORX = "worx"
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants used by Landroid Cloud."""

from __future__ import annotations

API_BASE = "https://{}/api/v2"
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/day_map.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Map days to integer."""

from __future__ import annotations

DAY_MAP = {
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/events.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Landroid Cloud callback events"""

# pylint: disable=unnecessary-lambda
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Landroid Cloud exception definitions."""

from __future__ import annotations


Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Helpers classes."""

from __future__ import annotations

from .logger import get_logger
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/helpers/logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Handling logger setup."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/helpers/time_format.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Time formatting helpers."""

from __future__ import annotations

import re
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utils."""

from __future__ import annotations

from .battery import Battery
Expand Down
15 changes: 10 additions & 5 deletions pyworxcloud/utils/battery.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Battery information."""

from __future__ import annotations

from enum import IntEnum
Expand Down Expand Up @@ -99,11 +100,15 @@ def _set_cycles(self, indata) -> None:
self["cycles"].update(
{
"reset_at": int(indata.battery_charge_cycles_reset),
"reset_time": string_to_time(
indata.battery_charge_cycles_reset_at, indata.time_zone
)
if not isinstance(indata.battery_charge_cycles_reset_at, type(None))
else None,
"reset_time": (
string_to_time(
indata.battery_charge_cycles_reset_at, indata.time_zone
)
if not isinstance(
indata.battery_charge_cycles_reset_at, type(None)
)
else None
),
}
)
else:
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/blades.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Blade information."""

from __future__ import annotations

from typing import Any
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/capability.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Device capabilities."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/devices.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Class for handling device info and states."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/firmware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Firmware information handler."""

from __future__ import annotations

from typing import Any
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/landroid_class.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A class set that helps representing data as wanted."""

from __future__ import annotations

from typing import Any
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/lawn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Handling lawn parameters."""

from __future__ import annotations

from .landroid_class import LDict
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/location.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Location information."""

from __future__ import annotations

from .landroid_class import LDict
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/mqtt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MQTT information class."""

from __future__ import annotations

import asyncio
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/orientation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Device orientation."""

from __future__ import annotations

from .landroid_class import LDict
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/product.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Handler for the physical device information."""

from __future__ import annotations

from enum import IntEnum
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/rainsensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Rain sensor information."""

from __future__ import annotations

from .landroid_class import LDict
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/requests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""For handling HTTP/HTTPS requests."""

from __future__ import annotations

from time import sleep
Expand Down
9 changes: 6 additions & 3 deletions pyworxcloud/utils/schedules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Defines schedule classes."""

from __future__ import annotations

import calendar
Expand Down Expand Up @@ -173,9 +174,11 @@ def __init__(self, data) -> None:
self["time_extension"] = 0
self["active"] = True
self["auto_schedule"] = {
"settings": data["auto_schedule_settings"]
if "auto_schedule_settings" in data
else {},
"settings": (
data["auto_schedule_settings"]
if "auto_schedule_settings" in data
else {}
),
"enabled": data["auto_schedule"] if "auto_schedule" in data else False,
}

Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/state.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""States handler."""

from __future__ import annotations

from enum import IntEnum
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/statistics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Landroid Cloud statistics class."""

from __future__ import annotations

from .landroid_class import LDict
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/warranty.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Warranty information handler."""

from __future__ import annotations

from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions pyworxcloud/utils/zone.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Zone representation."""

from __future__ import annotations

from .landroid_class import LDict
Expand Down
1 change: 1 addition & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic test file."""

import datetime
from os import environ

Expand Down

0 comments on commit 93d9597

Please sign in to comment.