Usage of rpi_envsens lib and pressure output added for client

This commit is contained in:
Dirk Alders 2020-09-04 12:26:24 +02:00
parent 1cfa3c4274
commit e14e8c4585

View File

@ -5,7 +5,7 @@ import config
import logging
import socket_protocol
import envsens
import rpi_envsens as envsens
logger = logging.getLogger('APP')
@ -46,6 +46,7 @@ class my_client_protocol_tcp(my_base_protocol_tcp):
env_data = msg.get_data()
print("Temperature: %6.1f °C" % env_data[envsens.KEY_TEMPERATURE])
print("Humidity: %6.1f %%" % env_data[envsens.KEY_HUMIDITY])
print("Pressure: %6.1f mbar" % env_data[envsens.KEY_PRESSURE])
return self.STATUS_OKAY, None
else:
print('No environmental data received!')