State

class pyhap.state.State(*, address: Union[str, List[str], None] = None, mac=None, pincode=None, port=None)[source]

Class to store all (semi-)static information.

That includes all needed for setup of driver and pairing.

add_paired_client(client_username_bytes: bytes, client_public: bytes, perms: bytes) → None[source]

Add a given client to dictionary of paired clients.

Parameters:
  • client_username_bytes (bytes) – The client’s user id bytes.
  • client_public (bytes) – The client’s public key (not the session public key).
address

Return the first address for backwards compat.

increment_config_version()[source]

Increment the config version.

is_admin(client_uuid: uuid.UUID) → bool[source]

Check if a paired client is an admin.

paired

Return if main accessory is currently paired.

remove_paired_client(client_uuid: uuid.UUID) → None[source]

Remove a given client from dictionary of paired clients.

Parameters:client_uuid (uuid.UUID) – The client’s UUID.
set_accessories_hash(accessories_hash)[source]

Set the accessories hash and increment the config version if needed.