The JoinFamily class provides functionality for a user to join a Spotify family plan hosted by another user.
-
user_login:
Login
The user's login object. -
host:
Family
The host user's family object. -
country:
str
The country to restrict the autocomplete to.
Initializes the JoinFamily class with the user's login, host family object, and country.
Adds the user to the host's family plan by retrieving the address and making the necessary API calls.
- Raises:
FamilyErrorif unable to add the user to the family.
The Family class provides methods for interacting with Spotify's family plan features.
- login:
Login
A logged-inLoginobject.
Initializes the Family class with the provided Login object. Raises a ValueError if the user does not have a premium subscription.
Retrieves the family home information for the user.
-
Returns:
A mapping of the family home information. -
Raises:
FamilyErrorif unable to get user plan info or if the response is not valid JSON.
Gets the list of family members.
- Returns:
A list of mappings, each representing a family member.
Checks if there is enough space in the family plan.
- Returns:
Trueif there are fewer than 6 members in the family plan, otherwiseFalse.