pyhomekit package

Submodules

pyhomekit.ble module

pyhomekit.constants module

pyhomekit.utils module

Useful functions for pyHomeKit.

pyhomekit.utils.iterate_tvl(response: bytes) → typing.Iterator[typing.Tuple[int, int, bytes]][source]

Iterate through response bytes, 1 tlv at a time.

pyhomekit.utils.parse_format(b: bytes) → typing.Tuple[int, int][source]

Parse the bluetooth characteristic presentation format to format and unit code

pyhomekit.utils.reconnect_callback_factory(peripheral: bluepy.btle.Peripheral) → typing.Callable[[typing.Callable[[typing.Any], typing.Any]], int][source]

Factory for creating tenacity before callbacks to reconnect to a peripheral.

pyhomekit.utils.reconnect_tenacity_retry(reconnect_callback: typing.Callable[[typing.Any], typing.Any], max_attempts: int = 2, wait_time: int = 1) → tenacity.Retrying[source]

Build tenacity retry object

pyhomekit.utils.to_bool(b: bytes) → bool[source]

Convert to bytes to bool (little endian).

pyhomekit.utils.to_float(b: bytes) → int[source]

Convert to bytes to float (little endian).

pyhomekit.utils.to_int32(b: bytes) → int[source]

Convert to bytes to 32 bit signed int (little endian).

pyhomekit.utils.to_uint16(b: bytes) → int[source]

Convert to bytes to 16 bit unsigned short (little endian).

pyhomekit.utils.to_uint32(b: bytes) → int[source]

Convert to bytes to 32 bit unsigned int (little endian).

pyhomekit.utils.to_uint64(b: bytes) → int[source]

Convert to bytes to 64 bit unsigned int (little endian).

pyhomekit.utils.to_uint8(b: bytes) → int[source]

Convert to bytes to 8 bit unsigned short (little endian).

pyhomekit.utils.to_utf8(b: bytes) → str[source]

Convert bytes to str utf-8 encoded.

pyhomekit.utils.to_uuid(b: bytes) → str[source]

Convert bytes to string representation of uuid.

The bytes are reversed first.

Module contents