Source code for sensirion_i2c_stc3x.result_types

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2024 Sensirion AG, Switzerland
#
#     THIS FILE IS AUTOMATICALLY GENERATED!
#
# Generator:     sensirion-driver-generator 0.38.1
# Product:       stc3x
# Model-Version: 1.0.0
#
"""
The signal classes specify transformations of the raw sensor signals into a meaningful units.
The generated signal types are used by the driver class and not intended for direct use.
"""

from sensirion_driver_support_types.signals import AbstractSignal


[docs]class SignalTemperature(AbstractSignal): """""" def __init__(self, raw_temperature): self._temperature = raw_temperature / 200.0 @property def value(self): return self._temperature def __str__(self): return '{0:.2f}'.format(self.value)
[docs]class SignalGasConcentration(AbstractSignal): """""" def __init__(self, raw_gas_concentration): self._gas_concentration = (100.0 * (raw_gas_concentration - 16384.0)) / 32768.0 @property def value(self): return self._gas_concentration def __str__(self): return '{0:.2f}'.format(self.value)