Skip to content

Commit

Permalink
Appease black
Browse files Browse the repository at this point in the history
  • Loading branch information
borski committed Jan 23, 2024
1 parent 5f6d5d1 commit b662e9c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion custom_components/lucidmotors/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class LucidNumberEntityDescriptionMixin:

key_path: list[str]
native_value_fn: Callable[[Vehicle], Coroutine[None, None, None]]
set_native_value_fn: Callable[[LucidAPI, Vehicle, float], Coroutine[None, None, None]]
set_native_value_fn: Callable[
[LucidAPI, Vehicle, float], Coroutine[None, None, None]
]


@dataclass(frozen=True)
Expand Down
14 changes: 11 additions & 3 deletions custom_components/lucidmotors/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
import logging
from typing import Any

from lucidmotors import APIError, LucidAPI, Vehicle, DefrostState, ChargeState, ChargeAction, AlarmStatus
from lucidmotors import (
APIError,
LucidAPI,
Vehicle,
DefrostState,
ChargeState,
ChargeAction,
AlarmStatus,
)

from homeassistant.components.switch import (
SwitchDeviceClass,
Expand Down Expand Up @@ -61,7 +69,7 @@ class LucidSwitchEntityDescription(
device_class=SwitchDeviceClass.SWITCH,
turn_on_function=lambda api, vehicle: api.start_charging(vehicle),
turn_off_function=lambda api, vehicle: api.stop_charging(vehicle),
on_value=ChargeState.CHARGE_STATE_CHARGING
on_value=ChargeState.CHARGE_STATE_CHARGING,
),
LucidSwitchEntityDescription(
key="status",
Expand All @@ -71,7 +79,7 @@ class LucidSwitchEntityDescription(
device_class=SwitchDeviceClass.SWITCH,
turn_on_function=lambda api, vehicle: api.turn_alarm_on(vehicle),
turn_off_function=lambda api, vehicle: api.turn_alarm_off(vehicle),
on_value=AlarmStatus.ALARM_STATUS_ARMED
on_value=AlarmStatus.ALARM_STATUS_ARMED,
),
)

Expand Down

0 comments on commit b662e9c

Please sign in to comment.