Skip to main content

AladdinConnect SDK

Authentication

OAuth Client

This SDK requires you to already have an OAuth client setup with us. The initial OAuth2.0 flow must be implemented by the users of this library as we provide no default implementation. More information on how to set this up will be provided when the OAuth client is set up.

Auth Class Implementation

The SDK provides an Auth class. It requires the following constructor parameters:

  • websession: an aiohttp.ClientSession that will be used for requests
  • host: the partner-specific base URL for the API
  • access_token: an initial access token to use (either cached or retrieved via the login flow)
  • api_key: a partner-specific API key provided during initial onboarding

This class also provides an abstract method async_get_access_token. This method is meant to be overridden with logic to handle checking the current token's validity and refreshing if needed. The refresh token will need to be managed outside of this class. Once this is implemented, the request method will automatically check the access token and set the appropriate authentication headers.

Model

Each garage door is modeled using the GarageDoor class that has the following properties:

  • device_id: a unique ID for the device (that could have multiple doors)
  • door_number: the index of the door, can be 1, 2 or 3
  • unique_id: a unique ID for the door of the format {DEVICE_ID}-{DOOR_NUMBER}
  • name: a user defined name for the door
  • status: the current state of the door, one of:
    • open: door is open
    • closed: door is closed
    • opening: door is in the process of being opened
    • closing: door is in the process of being closed
    • unknown: device has been recently setup or reset, requires a user to locally cycle the door open / closed to get the correct state
  • link_status: whether or not the door sensor is properly paired. Can be one of:
    • not_config: not yet configured, must use the app to pair
    • paired: configured, but not yet connected
    • connected: fully functional
  • battery_level: the current battery percentage (0 - 100) of the door sensor

Client

The AladdinConnectClient class provides the actual functionality of the API. It requires an Auth session to be configured (described above in the Authentication section). This class provides the following methods:

  • get_doors: Sync all the user's devices. This returns a list of GarageDoor instances as well as updating its own internal state
  • update_door: Sync a specific door and update the internal state
  • open_door: Issue an open command
  • open_door: Issue a close command
  • get_door_status: Return the current state of a door (this uses the internal state, it does not make a call to the API. To sync the state of a door, use update_door and then call this to get its status).
  • get_battery_status: Get the battery status of a door (this uses the internal state, it does not make a call to the API. To sync the state of a door, use update_door and then call this to get the battery status)

Release files for genie-partner-sdk 1.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genie-partner-sdk 1.0.11
File Size Uploaded
genie_partner_sdk-1.0.11.tar.gz 19.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for genie-partner-sdk 1.0.11
File Interpreter ABI Platform
genie_partner_sdk-1.0.11-py3-none-any.whl Python 3 none any Details

Total release size: 25.7 kB

Release files / genie_partner_sdk-1.0.11.tar.gz

Download URL genie_partner_sdk-1.0.11.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
78d78dfa6b693f363aa74895a3fa2dd1e2f36bf69e24fef43f1347c7bfcc5686
BLAKE2b-256 checksum
How to use checksums
b6b2f5f10454f381d609cd969b4227699731b78f11844c504d882e7ec4d18bfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / genie_partner_sdk-1.0.11-py3-none-any.whl

Download URL genie_partner_sdk-1.0.11-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65d7988ddd7cbd4f8b0240d4aeef7c7364dd839fb4c24c78baa01627940ea07c
BLAKE2b-256 checksum
How to use checksums
7f470d32539d76fd5b806f3c55094f95713c9687be01f397050bb04bcff47181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release history Release notifications | RSS feed

This release

1.0.11 This release

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page