Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow Class Reference
Inheritance diagram for homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow:
[legend]
Collaboration diagram for homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow:
[legend]

Public Member Functions

None __init__ (self)
 
None async_find_device (self, bool allow_exist=False)
 
ConfigFlowResult async_find_device_wrapper (self, Callable[[], Awaitable[ConfigFlowResult]] next_func, bool allow_exist=False)
 
ConfigFlowResult async_found_zeroconf_device (self, dict[str, str]|None user_input=None)
 
ConfigFlowResult async_pair_next_protocol (self)
 
ConfigFlowResult async_step_confirm (self, dict[str, str]|None user_input=None)
 
ConfigFlowResult async_step_pair_no_pin (self, dict[str, str]|None user_input=None)
 
ConfigFlowResult async_step_pair_with_pin (self, dict[str, str]|None user_input=None)
 
ConfigFlowResult async_step_password (self, dict[str, str]|None user_input=None)
 
ConfigFlowResult async_step_protocol_disabled (self, dict[str, str]|None user_input=None)
 
ConfigFlowResult async_step_reauth (self, Mapping[str, Any] entry_data)
 
ConfigFlowResult async_step_restore_device (self, dict[str, str]|None user_input=None)
 
ConfigFlowResult async_step_service_problem (self, dict[str, str]|None user_input=None)
 
ConfigFlowResult async_step_user (self, dict[str, str]|None user_input=None)
 
ConfigFlowResult async_step_zeroconf (self, zeroconf.ZeroconfServiceInfo discovery_info)
 
str|None device_identifier (self)
 
bool is_matching (self, Self other_flow)
 
- Public Member Functions inherited from homeassistant.config_entries.ConfigFlow
None __init_subclass__ (cls, *str|None domain=None, **Any kwargs)
 
ConfigFlowResult async_abort (self, *str reason, Mapping[str, str]|None description_placeholders=None)
 
ConfigFlowResult async_create_entry (self, *str title, Mapping[str, Any] data, str|None description=None, Mapping[str, str]|None description_placeholders=None, Mapping[str, Any]|None options=None)
 
ConfigEntry|None async_set_unique_id (self, str|None unique_id=None, *bool raise_on_progress=True)
 
ConfigFlowResult async_show_form (self, *str|None step_id=None, vol.Schema|None data_schema=None, dict[str, str]|None errors=None, Mapping[str, str]|None description_placeholders=None, bool|None last_step=None, str|None preview=None)
 
ConfigFlowResult async_step_bluetooth (self, BluetoothServiceInfoBleak discovery_info)
 
ConfigFlowResult async_step_dhcp (self, DhcpServiceInfo discovery_info)
 
ConfigFlowResult async_step_discovery (self, DiscoveryInfoType discovery_info)
 
ConfigFlowResult async_step_hassio (self, HassioServiceInfo discovery_info)
 
ConfigFlowResult async_step_homekit (self, ZeroconfServiceInfo discovery_info)
 
ConfigFlowResult async_step_ignore (self, dict[str, Any] user_input)
 
ConfigFlowResult async_step_integration_discovery (self, DiscoveryInfoType discovery_info)
 
ConfigFlowResult async_step_mqtt (self, MqttServiceInfo discovery_info)
 
ConfigFlowResult async_step_ssdp (self, SsdpServiceInfo discovery_info)
 
ConfigFlowResult async_step_usb (self, UsbServiceInfo discovery_info)
 
ConfigFlowResult async_step_user (self, dict[str, Any]|None user_input=None)
 
ConfigFlowResult async_step_zeroconf (self, ZeroconfServiceInfo discovery_info)
 
bool async_supports_options_flow (cls, ConfigEntry config_entry)
 
ConfigFlowResult async_update_reload_and_abort (self, ConfigEntry entry, *str|None|UndefinedType unique_id=UNDEFINED, str|UndefinedType title=UNDEFINED, Mapping[str, Any]|UndefinedType data=UNDEFINED, Mapping[str, Any]|UndefinedType data_updates=UNDEFINED, Mapping[str, Any]|UndefinedType options=UNDEFINED, str|UndefinedType reason=UNDEFINED, bool reload_even_if_entry_is_unchanged=True)
 
str|None unique_id (self)
 
- Public Member Functions inherited from homeassistant.data_entry_flow.FlowHandler
vol.Schema add_suggested_values_to_schema (self, vol.Schema data_schema, Mapping[str, Any]|None suggested_values)
 
None async_cancel_progress_task (self)
 
_FlowResultT async_create_entry (self, *str|None title=None, Mapping[str, Any] data, str|None description=None, Mapping[str, str]|None description_placeholders=None)
 
_FlowResultT async_external_step (self, *str|None step_id=None, str url, Mapping[str, str]|None description_placeholders=None)
 
_FlowResultT async_external_step_done (self, *str next_step_id)
 
asyncio.Task[Any]|None async_get_progress_task (self)
 
None async_remove (self)
 
None async_set_progress_task (self, asyncio.Task[Any] progress_task)
 
_FlowResultT async_show_menu (self, *str|None step_id=None, Container[str] menu_options, Mapping[str, str]|None description_placeholders=None)
 
_FlowResultT async_show_progress (self, *str|None step_id=None, str progress_action, Mapping[str, str]|None description_placeholders=None, asyncio.Task[Any]|None progress_task=None)
 
_FlowResultT async_show_progress_done (self, *str next_step_id)
 
bool show_advanced_options (self)
 
str|None source (self)
 

Static Public Member Functions

SchemaOptionsFlowHandler async_get_options_flow (ConfigEntry config_entry)
 
- Static Public Member Functions inherited from homeassistant.data_entry_flow.FlowHandler
None async_setup_preview (HomeAssistant hass)
 

Public Attributes

 all_identifiers
 
 atv_identifiers
 
 host
 
 pairing
 
 protocol
 
 protocols_to_pair
 
 scan_filter
 
- Public Attributes inherited from homeassistant.config_entries.ConfigFlow
 source
 
- Public Attributes inherited from homeassistant.data_entry_flow.FlowHandler
 deprecated_show_progress
 

Static Public Attributes

 None
 
int VERSION = 1
 
- Static Public Attributes inherited from homeassistant.data_entry_flow.FlowHandler
 Any
 
bool deprecated_show_progress = False
 
 HomeAssistant
 
string init_step = "init"
 
int MINOR_VERSION = 1
 
 None
 
 str
 
int VERSION = 1
 

Private Member Functions

None _async_aggregate_discoveries (self, str host, str unique_id)
 
None _async_check_and_update_in_progress (self, str host, str unique_id)
 
None _async_cleanup (self)
 
ConfigFlowResult _async_get_entry (self)
 
str|None _entry_unique_id_from_identifers (self, set[str] all_identifiers)
 

Private Attributes

 _host
 

Detailed Description

Handle a config flow for Apple TV.

Definition at line 95 of file config_flow.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.__init__ (   self)
Initialize a new AppleTVConfigFlow.

Definition at line 118 of file config_flow.py.

Member Function Documentation

◆ _async_aggregate_discoveries()

None homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow._async_aggregate_discoveries (   self,
str  host,
str  unique_id 
)
private
Wait for multiple zeroconf services to be discovered an aggregate them.

Definition at line 244 of file config_flow.py.

◆ _async_check_and_update_in_progress()

None homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow._async_check_and_update_in_progress (   self,
str  host,
str  unique_id 
)
private
Check for in-progress flows and update them with identifiers if needed.

Definition at line 285 of file config_flow.py.

◆ _async_cleanup()

None homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow._async_cleanup (   self)
private
Clean up allocated resources.

Definition at line 580 of file config_flow.py.

◆ _async_get_entry()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow._async_get_entry (   self)
private
Return config entry or update existing config entry.

Definition at line 586 of file config_flow.py.

◆ _entry_unique_id_from_identifers()

str | None homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow._entry_unique_id_from_identifers (   self,
set[str all_identifiers 
)
private
Search existing entries for an identifier and return the unique id.

Definition at line 145 of file config_flow.py.

◆ async_find_device()

None homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_find_device (   self,
bool   allow_exist = False 
)
Scan for the selected device to discover services.

Definition at line 339 of file config_flow.py.

◆ async_find_device_wrapper()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_find_device_wrapper (   self,
Callable[[], Awaitable[ConfigFlowResult]]  next_func,
bool   allow_exist = False 
)
Find a specific device and call another function when done.

This function will do error handling and bail out when an error
occurs.

Definition at line 317 of file config_flow.py.

◆ async_found_zeroconf_device()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_found_zeroconf_device (   self,
dict[str, str] | None   user_input = None 
)
Handle device found after Zeroconf discovery.

Definition at line 302 of file config_flow.py.

◆ async_get_options_flow()

SchemaOptionsFlowHandler homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_get_options_flow ( ConfigEntry  config_entry)
static
Get options flow for this handler.

Reimplemented from homeassistant.config_entries.ConfigFlow.

Definition at line 112 of file config_flow.py.

◆ async_pair_next_protocol()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_pair_next_protocol (   self)
Start pairing process for the next available protocol.

Definition at line 418 of file config_flow.py.

◆ async_step_confirm()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_step_confirm (   self,
dict[str, str] | None   user_input = None 
)
Handle user-confirmation of discovered node.

Definition at line 388 of file config_flow.py.

◆ async_step_pair_no_pin()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_step_pair_no_pin (   self,
dict[str, str] | None   user_input = None 
)
Handle step where user has to enter a PIN on the device.

Definition at line 529 of file config_flow.py.

◆ async_step_pair_with_pin()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_step_pair_with_pin (   self,
dict[str, str] | None   user_input = None 
)
Handle pairing step where a PIN is required from the user.

Definition at line 502 of file config_flow.py.

◆ async_step_password()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_step_password (   self,
dict[str, str] | None   user_input = None 
)
Inform user that password is not supported.

Definition at line 567 of file config_flow.py.

◆ async_step_protocol_disabled()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_step_protocol_disabled (   self,
dict[str, str] | None   user_input = None 
)
Inform user that a protocol is disabled and cannot be paired.

Definition at line 490 of file config_flow.py.

◆ async_step_reauth()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_step_reauth (   self,
Mapping[str, Any]   entry_data 
)
Handle initial step when updating invalid credentials.

Definition at line 154 of file config_flow.py.

◆ async_step_restore_device()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_step_restore_device (   self,
dict[str, str] | None   user_input = None 
)
Inform user that reconfiguration is about to start.

Definition at line 165 of file config_flow.py.

◆ async_step_service_problem()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_step_service_problem (   self,
dict[str, str] | None   user_input = None 
)
Inform user that a service will not be added.

Definition at line 554 of file config_flow.py.

◆ async_step_user()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_step_user (   self,
dict[str, str] | None   user_input = None 
)
Handle the initial step.

Definition at line 176 of file config_flow.py.

◆ async_step_zeroconf()

ConfigFlowResult homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.async_step_zeroconf (   self,
zeroconf.ZeroconfServiceInfo   discovery_info 
)
Handle device found via zeroconf.

Definition at line 206 of file config_flow.py.

◆ device_identifier()

str | None homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.device_identifier (   self)
Return a identifier for the config entry.

A device has multiple unique identifiers, but Home Assistant only supports one
per config entry. Normally, a "main identifier" is determined by pyatv by
first collecting all identifiers and then picking one in a pre-determine order.
Under normal circumstances, this works fine but if a service is missing or
removed due to deprecation (which happened with MRP), then another identifier
will be calculated instead. To fix this, all identifiers belonging to a device
is stored with the config entry and one of them (could be random) is used as
unique_id for said entry. When a new (zeroconf) service or device is
discovered, the identifier is first used to look up if it belongs to an
existing config entry. If that's the case, the unique_id from that entry is
re-used, otherwise the newly discovered identifier is used instead.

Definition at line 123 of file config_flow.py.

◆ is_matching()

bool homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.is_matching (   self,
Self  other_flow 
)
Return True if other_flow is matching this flow.

Reimplemented from homeassistant.config_entries.ConfigFlow.

Definition at line 290 of file config_flow.py.

Member Data Documentation

◆ _host

homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow._host
private

Definition at line 212 of file config_flow.py.

◆ all_identifiers

homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.all_identifiers

Definition at line 197 of file config_flow.py.

◆ atv_identifiers

homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.atv_identifiers

Definition at line 341 of file config_flow.py.

◆ host

homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.host

Definition at line 282 of file config_flow.py.

◆ None

homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.None
static

Definition at line 100 of file config_flow.py.

◆ pairing

homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.pairing

Definition at line 464 of file config_flow.py.

◆ protocol

homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.protocol

Definition at line 426 of file config_flow.py.

◆ protocols_to_pair

homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.protocols_to_pair

Definition at line 348 of file config_flow.py.

◆ scan_filter

homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.scan_filter

Definition at line 162 of file config_flow.py.

◆ VERSION

int homeassistant.components.apple_tv.config_flow.AppleTVConfigFlow.VERSION = 1
static
Handle a config flow for Apple TV.

Definition at line 98 of file config_flow.py.


The documentation for this class was generated from the following file: