Skip to content

Commit bd665c7

Browse files
committed
updated linting; fixed various linter issues
1 parent aef637f commit bd665c7

File tree

6 files changed

+21
-19
lines changed

6 files changed

+21
-19
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github: rsnodgrass
2+
patreon: rsnodgrass
3+
custom: ['https://buymeacoffee.com/DYks67r','https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=WREP29UDAMB6G']

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
.LSOverride
99

1010
# Icon must end with two \r
11-
Icon
11+
Icon
1212

1313
# Thumbnails
1414
._*

.pre-commit-config.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,8 @@ repos:
99
- id: trailing-whitespace
1010
- id: end-of-file-fixer
1111

12-
# isort - sort import statements
13-
# - repo: https://github.com/pycqa/isort
14-
# rev: 5.13.2
15-
# hooks:
16-
# - id: isort
17-
# files: \.(py)$
18-
# args: [--settings-path=pyproject.toml] # ["--profile", "black" ]
19-
2012
- repo: https://github.com/astral-sh/ruff-pre-commit
21-
rev: v0.9.2
13+
rev: v0.11.10
2214
hooks:
2315
- id: ruff
2416
args: [ --fix ] # run linter
@@ -34,6 +26,6 @@ repos:
3426
args: [--py311-plus] # NOTE: SET TO HOME ASSISTANT VERSION
3527

3628
- repo: https://github.com/dosisod/refurb
37-
rev: v2.0.0
29+
rev: v2.1.0
3830
hooks:
3931
- id: refurb # NOTE: Update pyproject.toml to match HA Python version

custom_components/xantech/media_player.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from homeassistant.components.media_player import (
99
PLATFORM_SCHEMA,
1010
MediaPlayerEntity,
11-
MediaPlayerEntityFeature
11+
MediaPlayerEntityFeature,
1212
)
1313
from homeassistant.const import (
1414
ATTR_ENTITY_ID,
@@ -32,8 +32,8 @@
3232
DOMAIN,
3333
SERVICE_RESTORE,
3434
SERVICE_SNAPSHOT,
35-
# SERVICE_JOIN,
36-
# SERVICE_UNJOIN,
35+
# SERVICE_JOIN,
36+
# SERVICE_UNJOIN,
3737
)
3838

3939
LOG = logging.getLogger(__name__)
@@ -49,7 +49,7 @@
4949
| MediaPlayerEntityFeature.VOLUME_SET
5050
| MediaPlayerEntityFeature.VOLUME_STEP
5151
| MediaPlayerEntityFeature.TURN_ON
52-
| MediaPlayerEntityFeature.TURN_OFF
52+
| MediaPlayerEntityFeature.TURN_OFF
5353
| MediaPlayerEntityFeature.SELECT_SOURCE
5454
)
5555

@@ -218,7 +218,6 @@ def __init__(self, namespace, name, amp, sources, zone_players):
218218
async def async_update(self):
219219
"""Retrieve the latest state from the amp."""
220220
LOG.debug('async_update() is empty')
221-
return
222221

223222
@property
224223
def unique_id(self):
@@ -360,8 +359,7 @@ def state(self):
360359
power = self._status.get('power')
361360
if power is not None and power is True:
362361
return STATE_ON
363-
else:
364-
return STATE_OFF
362+
return STATE_OFF
365363

366364
@property
367365
def volume_level(self):

custom_components/xantech/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ restore:
2727
# fields:
2828
# entities:
2929
# description: Entity ids of the zone players to unjoin.
30-
# example: "media_player.xantech8_deck"
30+
# example: "media_player.xantech8_deck"

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ lint.ignore = [
1313
[tool.ruff.format]
1414
quote-style = "single" # Use a single quote instead of double
1515

16+
# import sorting settings (replaces isort)
17+
[tool.ruff.lint.isort]
18+
force-single-line = false
19+
force-sort-within-sections = true
20+
known-first-party = ["custom_components"]
21+
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
22+
combine-as-imports = true
23+
force-to-top = ["logging"]
24+
1625
[tool.pycln]
1726
all = true
1827

0 commit comments

Comments
 (0)