> For the complete documentation index, see [llms.txt](https://huskoll-lib.albins.website/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://huskoll-lib.albins.website/functions-and-classes/the-huskoll-class.md).

# The Device class

The Device class is the only class that will be interacted with by the programmer and includes various functions for working with the Huskoll device.

### Initialization

Initialization of the class is done by passing the device hardware ID and a token.

The token can be obtained by emailing Huskoll according to their [API docs](https://documenter.getpostman.com/view/6416017/S1TYTvqb#4d0f5740-0f2a-430b-8217-4b320adae485).

The hardware ID can be found in the app or on the bottom of the sensor.

### Functions

#### get\_status()

Calls the Huskoll API to get the current status of the device. Updates the ".status" parameter of the class and returns a [Status](/functions-and-classes/the-status-class.md) object representing the current device status.

#### update\_status(new\_power\_status=None, new\_mode=None, new\_fan\_speed=None, new\_temperature=None)

Calls the Huskoll API to update one or multiple parameters for the device. Only one of these variables needs to be set - the rest will be taken from the current device status. *Tip:* Check out the quick helper functions below if you only want to update one parameter.

#### power\_off()

Powers off the heat pump. Does not change any other already set parameters. Shortcut function to update\_status.

#### power\_on()

Powers on the heat pump. Does not change any other already set parameters. Shortcut function to update\_status

#### set\_cooling()

Sets the device heating mode to cooling. Does not change any other already set parameters. Shortcut function to update\_status.&#x20;

#### set\_heating()

Sets the device heating mode to heating. Does not change any other already set parameters. Shortcut function to update\_status.&#x20;

#### fan\_speed\_low()

Sets the device fan speed to low. Does not change any other already set parameters. Shortcut function to update\_status.

#### fan\_speed\_medium()

&#x20;Sets the device fan speed to medium. Does not change any other already set parameters. Shortcut function to update\_status.

#### fan\_speed\_high()

Sets the device fan speed to high. Does not change any other already set parameters. Shortcut function to update\_status.

#### fan\_speed\_auto()

Sets the device fan speed to auto. Does not change any other already set parameters. Shortcut function to update\_status. Shortcut function to update\_status.&#x20;

#### set\_temp(new\_temp, supress\_warning=False)

Sets the heat pump to a new temperature as specified by new\_temp. If you get a warning by executing this function and want to ignore it, set the supress warning variable to True.

#### change\_temperature(by=1, force\_status\_update=False):

Function for changing the set temperature goal(set point) of the device by a certain steps.

Takes two optional keywords:&#x20;

**by** - how many steps to change the temperature with. Defaults to 1.

**force\_status\_update** - if not True, the device will use its stored status data if it has read the status before this function was called. Defaults to False.

#### def decrease\_temperature(by=1, force\_status\_update=False):

Function for decreasing the set temperature goal(set point) of the device by a certain steps.

Takes two optional keywords:&#x20;

**by** - how many steps to change the temperature with. Defaults to 1.

**force\_status\_update** - if not True, the device will use its stored status data if it has read the status before this function was called. Defaults to False.

This function calls change\_temperature under-the-hood.

#### increase\_temperature(by=1, force\_status\_update=False):

Function for decreasing the set temperature goal(set point) of the device by a certain steps.

Takes two optional keywords:&#x20;

**by** - how many steps to change the temperature with. Defaults to 1.

**force\_status\_update** - if not True, the device will use its stored status data if it has read the status before this function was called. Defaults to False.

This function calls change\_temperature under-the-hood.

### Internal helper functions

#### generate\_request\_auth()

Returns a dictionary with the required parameters to send to the Huskoll server for authentication. Takes no arguments.

### Helper variables

The class also provides the following helper variables, which are the strings that Huskoll's API accepts.

#### Power-related helpers

**POWER\_ON** and **POWER\_OFF**

#### Fan-related helpers

**FAN\_AUTO**, **FAN\_LOW**, **FAN\_MEDIUM**, and **FAN\_HIGH**&#x20;

#### Heating mode related helpers

**COOL** and **HEAT**.
