Skip to content

Commit

Permalink
black version is updated to 24.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ikaratass committed Jun 6, 2024
1 parent b0f988f commit b3715a3
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 73 deletions.
6 changes: 3 additions & 3 deletions iso15118/evcc/states/iso15118_20_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,9 @@ async def process_message(
service_discovery_res.service_renegotiation_supported
)

req_energy_services: List[
ServiceV20
] = await self.comm_session.ev_controller.get_supported_energy_services()
req_energy_services: List[ServiceV20] = (
await self.comm_session.ev_controller.get_supported_energy_services()
)

for energy_service in service_discovery_res.energy_service_list.services:
for requested_energy_service in req_energy_services:
Expand Down
6 changes: 3 additions & 3 deletions iso15118/evcc/states/iso15118_2_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ async def process_message(
await self.select_energy_transfer_mode()

charge_service: ChargeService = service_discovery_res.charge_service
offered_energy_modes: List[
EnergyTransferModeEnum
] = charge_service.supported_energy_transfer_mode.energy_modes
offered_energy_modes: List[EnergyTransferModeEnum] = (
charge_service.supported_energy_transfer_mode.energy_modes
)

if self.comm_session.selected_energy_mode not in offered_energy_modes:
self.stop_state_machine(
Expand Down
6 changes: 3 additions & 3 deletions iso15118/secc/comm_session_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ def __init__(
# The comm_sessions dict keys are of type str (the IPv6 address), the
# values are a tuple containing the SECCCommunicationSession and the
# associated ayncio.Task object (so we can cancel the task when needed)
self.comm_sessions: Dict[
str, Tuple[SECCCommunicationSession, asyncio.Task]
] = {}
self.comm_sessions: Dict[str, Tuple[SECCCommunicationSession, asyncio.Task]] = (
{}
)

async def start_session_handler(
self, iface: str, start_udp_server: Optional[bool] = True
Expand Down
6 changes: 3 additions & 3 deletions iso15118/secc/controller/ev_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ def __init__(
self.max_soc: Optional[int] = max_soc # 0-100
self.max_v2x_energy_request: Optional[float] = max_v2x_energy_request
self.min_v2x_energy_request: Optional[float] = min_v2x_energy_request
self.remaining_time_to_target_soc: Optional[
float
] = remaining_time_to_target_soc # noqa: E501
self.remaining_time_to_target_soc: Optional[float] = (
remaining_time_to_target_soc # noqa: E501
)
# In -2 is FullSOC
self.remaining_time_to_max_soc: Optional[float] = remaining_time_to_max_soc
self.remaining_time_to_min_soc: Optional[float] = remaining_time_to_min_soc
Expand Down
24 changes: 12 additions & 12 deletions iso15118/secc/controller/evse_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,21 @@ def __init__(
self.max_power_asymmetry: Optional[float] = max_power_asymmetry

# Optional in 15118-2 CPD
self.current_regulation_tolerance: Optional[
float
] = current_regulation_tolerance
self.current_regulation_tolerance: Optional[float] = (
current_regulation_tolerance
)
self.peak_current_ripple: Optional[float] = peak_current_ripple
self.energy_to_be_delivered: Optional[float] = energy_to_be_delivered
# Metering
self.present_active_power: Optional[
float
] = present_active_power # Optional in AC Scheduled CL
self.present_active_power_l2: Optional[
float
] = present_active_power_l2 # Optional in AC Scheduled CL
self.present_active_power_l3: Optional[
float
] = present_active_power_l3 # Optional in AC Scheduled CL
self.present_active_power: Optional[float] = (
present_active_power # Optional in AC Scheduled CL
)
self.present_active_power_l2: Optional[float] = (
present_active_power_l2 # Optional in AC Scheduled CL
)
self.present_active_power_l3: Optional[float] = (
present_active_power_l3 # Optional in AC Scheduled CL
)

# Required for -2 DC CurrentDemand, -20 DC CL
self.present_current: Union[float, int] = present_current
Expand Down
6 changes: 3 additions & 3 deletions iso15118/secc/states/din_spec_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ async def process_message(
# Any relays in the DC output circuit of the DC station shall
# be closed during the insulation test
# If None is returned, then contactor close operation is ongoing.
contactors_closed_for_cable_check: Optional[
bool
] = await self.comm_session.evse_controller.is_contactor_closed()
contactors_closed_for_cable_check: Optional[bool] = (
await self.comm_session.evse_controller.is_contactor_closed()
)

if contactors_closed_for_cable_check is not None:
if contactors_closed_for_cable_check:
Expand Down
18 changes: 9 additions & 9 deletions iso15118/secc/states/iso15118_20_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -1428,9 +1428,9 @@ async def process_message(
if ac_charge_loop_req.meter_info_requested:
meter_info = await self.comm_session.evse_controller.get_meter_info_v20()

evse_status: Optional[
EVSEStatus
] = await self.comm_session.evse_controller.get_evse_status()
evse_status: Optional[EVSEStatus] = (
await self.comm_session.evse_controller.get_evse_status()
)

response_code = ResponseCode.OK
params = None
Expand Down Expand Up @@ -1643,9 +1643,9 @@ async def process_message(
# Any relays in the DC output circuit of the DC station shall
# be closed during the insulation test
# If None is returned, then contactor close operation is ongoing.
contactors_closed_for_cable_check: Optional[
bool
] = await self.comm_session.evse_controller.is_contactor_closed()
contactors_closed_for_cable_check: Optional[bool] = (
await self.comm_session.evse_controller.is_contactor_closed()
)

if contactors_closed_for_cable_check is not None:
if contactors_closed_for_cable_check:
Expand Down Expand Up @@ -1843,9 +1843,9 @@ async def _build_dc_charge_loop_res(
)
) # noqa

evse_status: Optional[
EVSEStatus
] = await self.comm_session.evse_controller.get_evse_status()
evse_status: Optional[EVSEStatus] = (
await self.comm_session.evse_controller.get_evse_status()
)

meter_info: Optional[MeterInfo] = None
if meter_info_requested:
Expand Down
6 changes: 3 additions & 3 deletions iso15118/secc/states/iso15118_2_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,9 +1358,9 @@ async def process_message(
ev_data_context.selected_energy_mode.value.startswith("AC")
)

max_schedule_entries: Optional[
int
] = charge_params_req.max_entries_sa_schedule_tuple
max_schedule_entries: Optional[int] = (
charge_params_req.max_entries_sa_schedule_tuple
)

ac_evse_charge_params: Optional[ACEVSEChargeParameter] = None
dc_evse_charge_params: Optional[DCEVSEChargeParameter] = None
Expand Down
6 changes: 3 additions & 3 deletions iso15118/secc/states/secc_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class StateSECC(State, ABC):
# The response code can be set by various methods on which a State's
# process_message() method might rely on, such as is_message_valid().
# The default response code 'OK' can be overwritten as needed.
response_code: Union[
ResponseCodeDINSPEC, ResponseCodeV2, ResponseCodeV20
] = ResponseCodeV2.OK
response_code: Union[ResponseCodeDINSPEC, ResponseCodeV2, ResponseCodeV20] = (
ResponseCodeV2.OK
)

def __init__(
self, comm_session: "SECCCommunicationSession", timeout: Union[float, int] = 0
Expand Down
4 changes: 1 addition & 3 deletions iso15118/shared/exi_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,7 @@ def to_exi(self, msg_element: BaseModel, protocol_ns: str) -> bytes:

return exi_stream

def from_exi(
self, exi_message: bytes, namespace: str
) -> Union[
def from_exi(self, exi_message: bytes, namespace: str) -> Union[
SupportedAppProtocolReq,
SupportedAppProtocolRes,
V2GMessageV2,
Expand Down
54 changes: 27 additions & 27 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pytest = "^7.1.1"
pytest-asyncio = ">=0.18.3,<0.24.0"
asynctest = "^0.13.0"
freezegun = "^1.2.1"
black = "23.12.0"
black = "24.4.2"
isort = "^5.10.1"
flake8 = ">=4.0.1,<7.0.0"
pytest-cov = ">=3,<5"
Expand Down

0 comments on commit b3715a3

Please sign in to comment.