continue
# filter out unavailable players
# (unless disabled, otherwise there is no way to re-enable them)
+ # note that we only check for missing players in the player controller,
+ # and we do allow players that are temporary unavailable (player.available = false)
+ # because this can also mean that the player needs additional configuration
+ # such as airplay devices that need pairing.
player = self.mass.players.get(raw_conf["player_id"], False)
- if (
- not include_unavailable
- and (not player or not player.available)
- and raw_conf.get("enabled", True)
- ):
+ if not include_unavailable and player is None and raw_conf.get("enabled", True):
continue
# filter out disabled players
if not include_disabled and not raw_conf.get("enabled", True):
ConfigValueOption("Prefer AirPlay 2", StreamingProtocol.AIRPLAY2.value),
],
default_value=0,
+ category="protocol_generic",
),
ConfigEntry(
key=CONF_ENCRYPTION,
depends_on=CONF_AIRPLAY_PROTOCOL,
depends_on_value=StreamingProtocol.RAOP.value,
hidden=self.protocol != StreamingProtocol.RAOP,
+ category="protocol_generic",
advanced=True,
),
ConfigEntry(
depends_on=CONF_AIRPLAY_PROTOCOL,
depends_on_value=StreamingProtocol.RAOP.value,
hidden=self.protocol != StreamingProtocol.RAOP,
+ category="protocol_generic",
advanced=True,
),
CONF_ENTRY_SYNC_ADJUST,
required=False,
label="Device password",
description="Some devices require a password to connect/play.",
+ category="protocol_generic",
advanced=True,
),
# airplay has fixed sample rate/bit depth so make this config entry static and hidden
"volume changes. \n"
"Enable this option to ignore these reports."
),
- category="airplay",
+ category="protocol_generic",
# TODO: remove depends_on when DACP support is added for AirPlay2
depends_on=CONF_AIRPLAY_PROTOCOL,
depends_on_value=StreamingProtocol.RAOP.value,
type=ConfigEntryType.STRING,
label="Enter the 4-digit PIN shown on the device",
required=True,
+ category="protocol_generic",
)
)
entries.append(
type=ConfigEntryType.ACTION,
label=f"Complete {protocol_name} pairing with the PIN",
action=CONF_ACTION_FINISH_PAIRING,
+ category="protocol_generic",
)
)
else:
f"This device requires {protocol_name} pairing before it can be used. "
"Click the button below to start the pairing process."
),
+ category="protocol_generic",
)
)
entries.append(
type=ConfigEntryType.ACTION,
label=f"Start {protocol_name} pairing",
action=CONF_ACTION_START_PAIRING,
+ category="protocol_generic",
)
)
else:
key="pairing_status",
type=ConfigEntryType.LABEL,
label=f"Device is paired ({protocol_name}) and ready to use.",
+ category="protocol_generic",
)
)
# Add reset pairing button
type=ConfigEntryType.ACTION,
label=f"Reset {protocol_name} pairing",
action=CONF_ACTION_RESET_PAIRING,
+ category="protocol_generic",
)
)
value=values.get(conf_key) if values else None,
required=False,
hidden=True,
+ category="protocol_generic",
)
)
return entries