diff options
Diffstat (limited to 'src/temphum_smbus_util.py')
-rwxr-xr-x | src/temphum_smbus_util.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/temphum_smbus_util.py b/src/temphum_smbus_util.py deleted file mode 100755 index 0f90835..0000000 --- a/src/temphum_smbus_util.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -from argparse import ArgumentParser -from home.temphum import SensorType, create_sensor - - -if __name__ == '__main__': - parser = ArgumentParser() - parser.add_argument('-t', '--type', choices=[item.value for item in SensorType], - required=True, - help='Sensor type') - parser.add_argument('-b', '--bus', type=int, default=0, - help='I2C bus number') - arg = parser.parse_args() - - sensor = create_sensor(SensorType(arg.type), arg.bus) - temp = sensor.temperature() - hum = sensor.humidity() - - print(f'temperature: {temp}') - print(f'rel. humidity: {hum}') |