pysaleryd package

Subpackages

Submodules

pysaleryd.client module

HRV System client

class pysaleryd.client.Client(ip: str, port: int = 3001, update_interval=30, connect_timeout=15)[source]

Bases: object

Client to manage communication with HRV

add_data_handler(handler: Callable[[dict[DataKey, str]], None])[source]

Add data handler to be called at update interval

Parameters:

handler (Callable[[dict[DataKey, str]], None]) – handler function. Must be safe to call from event loop

add_state_change_handler(handler: Callable[[State], None])[source]

Add state change handler to be called when client state changes

Parameters:

handler (Callable[[str], None]) – handler to be added

close()[source]

Disconnect from system

connect()[source]

Connect to HRV and begin receiving

property data

Get data from system if connection is alive

remove_data_handler(handler: Callable[[dict[DataKey, str]], None])[source]

Remove data handler

Parameters:

handler (Callable[[dict[DataKey, str]], None]) – handler to remove

remove_state_change_handler(handler: Callable[[State], None])[source]

Remove state change handler

Parameters:

handler (Callable[[str], None]) – handler to be removed

async send_command(key: MessageType, payload: str | int)[source]

Send command to HRV unit

Parameters:
  • key (MessageType) – message type key

  • payload – payload

property state

State of the underlying websocket connection

pysaleryd.const module

Constants

class pysaleryd.const.DataKey(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Data key enumerator

AIR_TEMPERATURE_AT_HEATER = '*TK'
AIR_TEMPERATURE_SUPPLY = '*TC'
CONTROL_SYSTEM_STATE = 'MP'
CONTROL_SYSTEM_VERSION = '*SC'
COOLING_MODE = 'MK'
ERROR_FRAME_END = '*EZ'
ERROR_FRAME_START = '*EA'
ERROR_MESSAGE = '*EB'
FAN_SPEED_EXHAUST = '*DB'
FAN_SPEED_SUPPLY = '*DA'
FILTER_MONTHS_LEFT = '*FL'
FIREPLACE_MODE = 'MB'
HEATER_POWER_PERCENT = '*MJ'
HEAT_EXCHANGER_ROTOR_PERCENT = '*XA'
HEAT_EXCHANGER_ROTOR_RPM = '*XB'
INSTALLER_EMAIL = 'IB'
INSTALLER_NAME = 'IA'
INSTALLER_PASSWORD = 'IP'
INSTALLER_PHONE = 'IC'
INSTALLER_WEBSITE = 'IE'
MINUTES_LEFT_BOOST_MODE = '*FI'
MINUTES_LEFT_FIREPLACE_MODE = '*ME'
MODEL_NAME = '*SB'
MODE_FAN = 'MF'
MODE_HEATER = 'MH'
MODE_HEATER_POWER_RATING = 'MG'
MODE_TEMPERATURE = 'MT'
PRODUCT_NUMBER = '*SA'
TARGET_TEMPERATURE_COOL = 'TF'
TARGET_TEMPERATURE_ECONOMY = 'TE'
TARGET_TEMPERATURE_NORMAL = 'TD'
class pysaleryd.const.MessageType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Message type

ACK_ERROR = 1
ACK_OK = 0
MESSAGE = 2
RAW = 3
class pysaleryd.const.PayloadSeparator(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Message payload separator

ACK_ERROR = '!'
ACK_OK = '$'
MESSAGE_START = '#'
PAYLOAD_START = ':'

pysaleryd.data module

Utils

class pysaleryd.data.BaseSystemProperty[source]

Bases: object

HRV System property

class pysaleryd.data.ErrorSystemProperty(key: DataKey, value: list[str] | None = None)[source]

Bases: BaseSystemProperty

HRV System error property

class pysaleryd.data.IncomingMessage[source]

Bases: object

Incoming message from system

static from_str(msg: str) tuple[DataKey, str, MessageType][source]

Parse message string

Parameters:

msg (str) – raw message

Raises:

ParseError – if parsing fails

Returns:

parsed message key and value

Return type:

(key, value, message_type)

class pysaleryd.data.OutgoingMessage(key: DataKey, value: str)[source]

Bases: object

Outgoing message to system

key: DataKey
value: str
exception pysaleryd.data.ParseError[source]

Bases: BaseException

Parse error. Raised when message parsing fails

class pysaleryd.data.SystemProperty(key: DataKey, value: int | str | None = None, min_value: int | str | None = None, max_value: int | str | None = None, *_args)[source]

Bases: BaseSystemProperty

HRV System property with value, min, max

classmethod from_str(key: DataKey, raw_value: str)[source]

Create instance from from string

Module contents