Skip to content

Commit 5f9c2c2

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 51339bc commit 5f9c2c2

File tree

6 files changed

+26
-29
lines changed

6 files changed

+26
-29
lines changed

pyalarmdotcomajax/adc/adc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""adc core CLI functions."""
22

3-
# ruff: noqa: T201 C901 UP007 FBT002 FBT001
3+
# ruff: noqa: FBT002, FBT001
44
import asyncio
55
import logging
66
import sys
77
from functools import partial
8-
from typing import TYPE_CHECKING, Annotated, Optional
8+
from typing import TYPE_CHECKING, Annotated
99

1010
import typer
1111
from rich import print
@@ -55,7 +55,7 @@ def version_callback(value: bool) -> None:
5555
@app.callback()
5656
def adc_callback(
5757
version: Annotated[
58-
Optional[bool],
58+
bool | None,
5959
typer.Option(
6060
"--version",
6161
help="Get installed pyalarmdotcom version.",
@@ -116,7 +116,7 @@ async def stream(
116116
async def get(
117117
ctx: typer.Context,
118118
include_unsupported: Annotated[
119-
Optional[bool],
119+
bool | None,
120120
typer.Option(
121121
"--include-unsupported",
122122
"-x",

pyalarmdotcomajax/adc/common.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Common commands for the adc CLI."""
22

3-
# ruff: noqa: T201 C901 UP007 FBT002 FBT001
3+
# ruff: noqa: FBT002, FBT001
44

55
import asyncio
66
import logging
77
from functools import partial
8-
from typing import Annotated, Optional
8+
from typing import Annotated
99

1010
import aiohttp
1111
import typer
@@ -179,7 +179,7 @@ async def collect_params(
179179
),
180180
],
181181
cookie: Annotated[
182-
Optional[str],
182+
str | None,
183183
typer.Option(
184184
"--cookie",
185185
"-c",
@@ -193,7 +193,7 @@ async def collect_params(
193193
# MFA OPTIONS
194194
#
195195
otp_method: Annotated[
196-
Optional[OtpType],
196+
OtpType | None,
197197
typer.Option(
198198
"--otp-method",
199199
"-m",
@@ -206,7 +206,7 @@ async def collect_params(
206206
),
207207
] = None,
208208
otp: Annotated[
209-
Optional[str],
209+
str | None,
210210
typer.Option(
211211
"--otp",
212212
"-o",
@@ -216,7 +216,7 @@ async def collect_params(
216216
),
217217
] = None,
218218
device_name: Annotated[
219-
Optional[str],
219+
str | None,
220220
typer.Option(
221221
"--device-name",
222222
"-n",

pyalarmdotcomajax/adc/util.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Helpers for adc CLI."""
22

3-
# ruff: noqa: T201 C901 UP007
43

54
import asyncio
65
import inspect
@@ -9,7 +8,7 @@
98
from functools import wraps
109
from itertools import chain, compress, groupby
1110
from operator import attrgetter
12-
from typing import Annotated, Any, Optional, TypeVar, get_type_hints
11+
from typing import Annotated, Any, TypeVar, get_type_hints
1312

1413
import click
1514
import typer
@@ -326,7 +325,7 @@ class ValueEnum(click.Choice):
326325
name = "value_enum"
327326

328327
def __init__(
329-
self, target_type: type[Enum], exclude: Optional[list[str]] = None
328+
self, target_type: type[Enum], exclude: list[str] | None = None
330329
) -> None:
331330
"""Initialize the OtpParamType class."""
332331

@@ -340,8 +339,8 @@ def __init__(
340339
def convert(
341340
self,
342341
value: Any,
343-
param: Optional[click.Parameter],
344-
ctx: Optional[click.Context],
342+
param: click.Parameter | None,
343+
ctx: click.Context | None,
345344
) -> Any:
346345
"""Convert the selection to the enum member's value to meet Typer conventions."""
347346

pyalarmdotcomajax/controllers/garage_doors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Alarm.com controller for garage doors."""
22

3-
# ruff: noqa: UP007
43

54
import logging
65
from enum import StrEnum

pyalarmdotcomajax/controllers/partitions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Alarm.com controller for partitions."""
22

3-
# ruff: noqa: UP007 FBT002 FBT001
3+
# ruff: noqa: FBT002
44

55
import logging
66
from enum import StrEnum
77
from types import MappingProxyType
8-
from typing import Annotated, Any, Optional
8+
from typing import Annotated, Any
99

1010
import typer
1111

@@ -222,7 +222,7 @@ async def set_state(
222222
self,
223223
id: str,
224224
state: PartitionState,
225-
extended_arming_options: Optional[list[ExtendedArmingOptionItems]] = None,
225+
extended_arming_options: list[ExtendedArmingOptionItems] | None = None,
226226
) -> None:
227227
"""Change partition state."""
228228

@@ -256,11 +256,11 @@ async def change_sensor_bypass(
256256
self,
257257
partition_id: Param_Id,
258258
bypass_ids: Annotated[
259-
Optional[list[str]],
259+
list[str] | None,
260260
typer.Option(help="List of sensors to bypass.", show_default=True),
261261
] = None,
262262
unbypass_ids: Annotated[
263-
Optional[list[str]],
263+
list[str] | None,
264264
typer.Option(help="List of sensors to unbypass.", show_default=True),
265265
] = None,
266266
) -> None:

pyalarmdotcomajax/controllers/thermostats.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""Alarm.com controller for thermostats."""
22

3-
# ruff: noqa: UP007
43

54
import logging
6-
from typing import TYPE_CHECKING, Annotated, Any, Optional
5+
from typing import TYPE_CHECKING, Annotated, Any
76

87
import typer
98

@@ -81,7 +80,7 @@ async def set_state(
8180
self,
8281
id: Annotated[str, typer.Option(help="The ID of the thermostat.", show_default=False)],
8382
state: Annotated[
84-
Optional[ThermostatState],
83+
ThermostatState | None,
8584
typer.Option(
8685
click_type=ValueEnum(ThermostatState, "UNKNOWN"),
8786
case_sensitive=False,
@@ -90,7 +89,7 @@ async def set_state(
9089
),
9190
] = None,
9291
fan_mode: Annotated[
93-
Optional[ThermostatFanMode],
92+
ThermostatFanMode | None,
9493
typer.Option(
9594
click_type=ValueEnum(ThermostatFanMode, ["UNKNOWN"]),
9695
case_sensitive=False,
@@ -99,22 +98,22 @@ async def set_state(
9998
),
10099
] = None,
101100
fan_mode_duration: Annotated[
102-
Optional[int],
101+
int | None,
103102
typer.Option(
104103
help="The duration for which the desired fan mode should run. Fan duration must be in device's list of supported durations.",
105104
show_default=False,
106105
),
107106
] = None,
108107
cool_setpoint: Annotated[
109-
Optional[float],
108+
float | None,
110109
typer.Option(help="The desired cool setpoint.", show_default=False),
111110
] = None,
112111
heat_setpoint: Annotated[
113-
Optional[float],
112+
float | None,
114113
typer.Option(help="The desired heat setpoint.", show_default=False),
115114
] = None,
116115
schedule_mode: Annotated[
117-
Optional[ThermostatScheduleMode],
116+
ThermostatScheduleMode | None,
118117
typer.Option(
119118
click_type=ValueEnum(ThermostatScheduleMode),
120119
case_sensitive=False,

0 commit comments

Comments
 (0)