Source code for sensirion_i2c_sbn4x.result_types

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2026 Sensirion AG, Switzerland
#
#     THIS FILE IS AUTOMATICALLY GENERATED!
#
# Generator:     sensirion-driver-generator 1.5.1
# Product:       sbn4x
# Model-Version: 2.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 SignalI16ToFloat(AbstractSignal): """Return the scaled int16_t value as unscaled floating point value.""" def __init__(self, value): self._i16_to_float = float(value) / 256 @property def value(self): return self._i16_to_float def __str__(self): return '{0:.2f}'.format(self.value)
[docs] class SignalU32ToFloat(AbstractSignal): """Return the scaled uint32_t value as unscaled floating point value.""" def __init__(self, value): self._u32_to_float = float(value) / 256 @property def value(self): return self._u32_to_float def __str__(self): return '{0:.2f}'.format(self.value)