Reference¶
pyyaledoorman.Client¶
Yale API Client. Used to log in to the API and instantiate Devices.
-
exception
pyyaledoorman.client.
AuthenticationError
(*args)¶ Exception for authentication errors.
- Parameters
args (Any) –
- Return type
None
-
class
pyyaledoorman.client.
Client
(username, password, initial_token='VnVWWDZYVjlXSUNzVHJhcUVpdVNCUHBwZ3ZPakxUeXNsRU1LUHBjdTpkd3RPbE15WEtENUJ5ZW1GWHV0am55eGhrc0U3V0ZFY2p0dFcyOXRaSWNuWHlSWHFsWVBEZ1BSZE1xczF4R3VwVTlxa1o4UE5ubGlQanY5Z2hBZFFtMHpsM0h4V3dlS0ZBcGZzakpMcW1GMm1HR1lXRlpad01MRkw3MGR0bmNndQ==', session=None)¶ Yale Doorman client.
- Parameters
username – Username for logging in to the Yale API.
password – Password for logging in to the Yale API.
initial_token – Initial token for logging in to the Yale API.
session (optional) – aiohttp ClientSession to use.
-
property
devices
¶ Return list of Devices.
-
async
login
()¶ Log in to the Yale API.
- Returns
True if successfully logged in.
- Return type
bool
- Raises
AuthenticationError – Supplied username, password or initial token is wrong.
-
property
login_ts
¶ Return the login timestamp.
-
property
refresh_token
¶ Return the refresh token.
-
property
session
¶ Return the aiohttp session.
-
property
token
¶ Return the access token.
-
property
token_expires_in
¶ Return seconds from login whence the access token expires.
-
async
update_devices
()¶ Update the device states.
- Return type
None
pyyaledoorman.Device¶
A Yale Doorman Device instance.
-
class
pyyaledoorman.device.
Device
(client, device_config)¶ Used to instantiate a Yale Doorman device.
-
property
address
¶ Return the device address, most times synonymous with device_id.
-
property
area
¶ Return the device area.
-
property
autolock_enabled
¶ Return whether autolock is enabled.
- Returns
True if autolock is enabled, otherwise False
- Return type
bool
-
property
device_id
¶ Return the device ID.
-
async
disable_autolock
()¶ Disable autolocking of the lock.
- Returns
True if successful, False otherwise.
- Return type
bool
-
async
enable_autolock
()¶ Enable autolocking of the lock.
- Returns
True if successful, False otherwise.
- Return type
bool
-
async
get_deviceconfig
()¶ Fetch the device configuration.
- Returns
The raw API response.
- Return type
Dict[str, str]
-
property
is_locked
¶ Return True if the lock is locked. Otherwise False.
-
property
is_open
¶ Return True if the door is open. Otherwise False.
-
property
language
¶ Return audio language.
- Returns
LANG_EN, LANG_DA, LANG_NO, LANG_SE, LANG_FI, LANG_RU, LANG_TR.
- Return type
The configured language of the device. Possible value are
-
async
lock
()¶ Lock the lock and update the internal state to YALE_LOCK_STATE_LOCKED.
- Returns
True if locking was successful, False otherwise.
- Return type
bool
-
property
name
¶ Return the device name.
-
parse_config
(device_config)¶ Parse API responses and sets Device configuration.
- Parameters
device_config (Dict[str, str]) –
- Return type
None
-
async
set_deviceconfig
(config_idx, value)¶ Set device configuration.
- Parameters
config_idx (str) – index of the confiuration option to change.
value (str) – new value to write.
- Returns
True if the device config was updated successfully, False otherwise.
- Return type
bool
-
property
state
¶ Return device state.
For locks the state is usually one of: * device_status.lock * device_status.unlock
-
property
type
¶ Return device type.
Only device_type.door_lock is supported at the time being
-
async
unlock
(pincode)¶ Unlocks the lock. Takes pincode as a required parameter to unlock.
- Parameters
pincode (str) – a valid Yale Doorman pincode
- Returns
True if unlock successful, False otherwise.
- Return type
bool
-
async
update_state
()¶ Update the Device status from the API.
- Return type
None
-
property
volume_level
¶ Return volume level.
- Returns
VOLUME_HIGH, VOLUME_LOW, VOLUME_OFF
- Return type
The configured volume level. Possible values are
-
property