Skip to content

Commit 458833b

Browse files
rsnodgrassSage-Ox
andcommitted
Fix ruff linting errors
- Remove unused get_device_config import from config_flow.py - Fix import order in number.py - Break long lines to stay within 88 char limit Co-Authored-By: SageOx <ox@sageox.ai>
1 parent c9c3207 commit 458833b

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

custom_components/xantech/config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
TextSelectorConfig,
2525
TextSelectorType,
2626
)
27-
from pyxantech import async_get_amp_controller, get_device_config
27+
from pyxantech import async_get_amp_controller
2828
from serial import SerialException
2929
import voluptuous as vol
3030

custom_components/xantech/number.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from homeassistant.helpers.device_registry import DeviceInfo
1111
from homeassistant.helpers.entity_platform import AddEntitiesCallback
1212
from homeassistant.helpers.update_coordinator import CoordinatorEntity
13-
1413
from pyxantech import get_device_config
1514

1615
from .const import (
@@ -45,18 +44,33 @@ async def async_setup_entry(
4544
amp_type = data.amp_type
4645

4746
# check device capabilities for tone controls
48-
supports_bass = get_device_config(amp_type, 'supports_bass', log_missing=False) or False
49-
supports_treble = get_device_config(amp_type, 'supports_treble', log_missing=False) or False
50-
supports_balance = get_device_config(amp_type, 'supports_balance', log_missing=False) or False
47+
supports_bass = (
48+
get_device_config(amp_type, 'supports_bass', log_missing=False) or False
49+
)
50+
supports_treble = (
51+
get_device_config(amp_type, 'supports_treble', log_missing=False) or False
52+
)
53+
supports_balance = (
54+
get_device_config(amp_type, 'supports_balance', log_missing=False) or False
55+
)
5156

5257
if not (supports_bass or supports_treble or supports_balance):
5358
LOG.debug('Device %s does not support any tone controls', amp_type)
5459
return
5560

5661
# get device-specific limits from pyxantech config
57-
max_bass = get_device_config(amp_type, 'max_bass', log_missing=False) or DEFAULT_MAX_BASS
58-
max_treble = get_device_config(amp_type, 'max_treble', log_missing=False) or DEFAULT_MAX_TREBLE
59-
max_balance = get_device_config(amp_type, 'max_balance', log_missing=False) or DEFAULT_MAX_BALANCE
62+
max_bass = (
63+
get_device_config(amp_type, 'max_bass', log_missing=False)
64+
or DEFAULT_MAX_BASS
65+
)
66+
max_treble = (
67+
get_device_config(amp_type, 'max_treble', log_missing=False)
68+
or DEFAULT_MAX_TREBLE
69+
)
70+
max_balance = (
71+
get_device_config(amp_type, 'max_balance', log_missing=False)
72+
or DEFAULT_MAX_BALANCE
73+
)
6074

6175
zones_config = entry.data.get(CONF_ZONES, {})
6276

0 commit comments

Comments
 (0)