|
10 | 10 | from homeassistant.helpers.device_registry import DeviceInfo |
11 | 11 | from homeassistant.helpers.entity_platform import AddEntitiesCallback |
12 | 12 | from homeassistant.helpers.update_coordinator import CoordinatorEntity |
13 | | - |
14 | 13 | from pyxantech import get_device_config |
15 | 14 |
|
16 | 15 | from .const import ( |
@@ -45,18 +44,33 @@ async def async_setup_entry( |
45 | 44 | amp_type = data.amp_type |
46 | 45 |
|
47 | 46 | # 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 | + ) |
51 | 56 |
|
52 | 57 | if not (supports_bass or supports_treble or supports_balance): |
53 | 58 | LOG.debug('Device %s does not support any tone controls', amp_type) |
54 | 59 | return |
55 | 60 |
|
56 | 61 | # 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 | + ) |
60 | 74 |
|
61 | 75 | zones_config = entry.data.get(CONF_ZONES, {}) |
62 | 76 |
|
|
0 commit comments