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.

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 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.

set_heating()

Sets the device heating mode to heating. Does not change any other already set parameters. Shortcut function to update_status.

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()

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.

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:

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:

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:

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_ON and POWER_OFF

FAN_AUTO, FAN_LOW, FAN_MEDIUM, and FAN_HIGH

COOL and HEAT.

Last updated