comparison weatherlog/reader.py @ 1:b52600fade25

reader: Fix attr order in Reading.
author Paul Fisher <paul@pfish.zone>
date Fri, 27 Sep 2019 21:36:16 -0400
parents 18dc6245c91a
children 9310e2ff7e17
comparison
equal deleted inserted replaced
0:18dc6245c91a 1:b52600fade25
21 21
22 @attr.s(frozen=True, slots=True) 22 @attr.s(frozen=True, slots=True)
23 class Reading(object): 23 class Reading(object):
24 """A single reading from a temperature/humidity sensor.""" 24 """A single reading from a temperature/humidity sensor."""
25 25
26 # The timestamp of the reading.
27 timestamp = attr.ib(type=datetime.datetime, factory=_utc_now)
28
29 # The temperature, in degrees Celsius. 26 # The temperature, in degrees Celsius.
30 temp_c = attr.ib(type=float) 27 temp_c = attr.ib(type=float)
31 28
32 # The relative humidity, in percent. 29 # The relative humidity, in percent.
33 rh_pct = attr.ib(type=float) 30 rh_pct = attr.ib(type=float)
31
32 # The timestamp of the reading.
33 timestamp = attr.ib(type=datetime.datetime, factory=_utc_now)
34 34
35 35
36 class Reader(metaclass=abc.ABCMeta): 36 class Reader(metaclass=abc.ABCMeta):
37 """Interface for a thing which reads temperatures.""" 37 """Interface for a thing which reads temperatures."""
38 38