pyisyox.helpers package

Helper functions for the PyISYoX Module.

parse_isy_datetime(dt_str)[source]

Parse an ISY datetime string, returning EMPTY_TIME on failure.

Handles the four documented ISY datetime formats plus an ISO 8601 fallback. Replaces the prior dependency on python-dateutil.

Parameters:

dt_str (str | None)

Return type:

datetime

convert_isy_raw_value(value, uom, precision, fallback_precision=None)[source]

Fix ISY Reported Values.

ISY provides float values as an integer and precision component. Correct by shifting the decimal place left by the value of precision. (e.g. value=2345, precision=2 → 23.45; wire keys it as “prec”)

Insteon Thermostats report temperature in 0.5-deg precision as an int by sending a value of 2 times the Temp. Correct by dividing by 2 here.

Parameters:
  • value (int | float) – The value to convert.

  • uom (str, optional) – The ISY Unit of Measure code. Default is None.

  • precision (int | str) – The precision (decimal places) to convert the value to.

  • fallback_precision (int, optional) – The fallback precision to use with normal rounding. Default is None.

Returns:

The converted value

Return type:

float | int

Submodules