smartgadget.shtc1 module

class smartgadget.shtc1.SHTC1(device, interface=None)[source]

Bases: SmartGadget

Base class for a Smart Gadget.

Parameters
  • device – A MAC address as a str or a ScanEntry object.

  • interface (int, optional) – The Bluetooth interface to use for the connection. For example, 0 or None means /dev/hci0, 1 means /dev/hci1.

DEVICE_NAME = 'SHTC1 smart gadget'
TEMPERATURE_HUMIDITY_CHARACTERISTIC_UUID = <bluepy.btle.UUID object>
battery() int[source]

Returns the battery level.

Returns

float – The current battery level [%].

humidity() float[source]

Returns the current humidity.

Returns

float – The current humidity [%RH].

info() dict[source]

Returns all available information from the Smart Gadget.

Returns

dict – Includes information such as the firmware, hardware and software version numbers, the battery level, the temperature, humidity and dew point values.

temperature() float[source]

Returns the current temperature.

Returns

float – The current temperature [degree C].

temperature_humidity() Tuple[float, float][source]

Returns the current temperature and humidity.

Returns

  • float – The current temperature [degree C].

  • float – The current humidity [%RH].

class smartgadget.shtc1.SHTC1Service(interface=None)[source]

Bases: SmartGadgetService

The Service for a SHTC1 Smart Gadget.

Parameters

interface (int, optional) – The Bluetooth interface to use for the connection. For example, 0 or None means /dev/hci0, 1 means /dev/hci1.