Quickstart

Quickstart

The library is easy and straightforward to use - it has one main class that represents a Huskoll Device.

Obtain an access token

To use the API (and this library), you need to have an access token. According to the Huskoll API docs, you can obtain that by sending an email to [email protected].

Obtain your hardware ID

To use the API (and this library), you also need to obtain the Hardware ID for the device(s) you want to interract with. The Hardware ID is visible in the Huskoll App, and also on a sticker on the bottom of the Huskoll device. (at least in the devices I checked with, hardware version 1.3)

Installation

The Huskoll Python Library will soon be available via PyPi under the package name huskoll.

And now, to the code!

Below are some code examples which shows what you can do with the library. There are more parameters and functions available which might help a lot - make sure to check out the docs for the Device class and the Status class!

Initialization of devices

This code shows the standard three-liner initialization code for devices.

from huskoll import Huskoll
TOKEN = "YOUR_TOKEN_HERE" #Replace this with your token
HARDWARE_ID = "YOUR_HARDWARE_ID_HERE" #Replace this with the hardware ID of the device you wish to control
device = Huskoll.Device(token=TOKEN, hardware_id=HARDWARE_ID) #Create an object to work with the device. You can create as many of these as you want for multiple devices.

Basic functions, executed one-by-one

This example shows the execution of some basic functions, one-by-one. Overwhelmed? Scroll a bit further down :)

Update multiple parameters at once

This example shows how to update multiple parameters to Huskoll at once, limiting the number of API requests and making the code prettier.

Get device status

Last updated

Was this helpful?