Convert enabled for Client, Probe to use datetime instead of boolean

value is null if disabled, else timestamp of when it was last enabled
This commit is contained in:
Lance Edgar 2019-01-25 19:33:49 -06:00
parent c45baaed5e
commit f31a0c4c22
4 changed files with 96 additions and 10 deletions

View file

@ -111,11 +111,11 @@ class Client(Base):
Any arbitrary notes for the client.
""")
enabled = sa.Column(sa.Boolean(), nullable=False, default=False, doc="""
Whether the client should be considered enabled (active). If set, the
client will be expected to take readings (but only for "enabled" probes)
and the server will monitor them to ensure they are within the expected
range etc.
enabled = sa.Column(sa.DateTime(), nullable=True, doc="""
This will either be the date/time when the client was most recently
enabled, or null if it is not currently enabled. If set, the client will
be expected to take readings (but only for "enabled" probes) and the server
will monitor them to ensure they are within the expected range etc.
""")
online = sa.Column(sa.Boolean(), nullable=False, default=False, doc="""
@ -191,7 +191,13 @@ class Probe(Base):
""")
device_path = sa.Column(sa.String(length=255), nullable=True)
enabled = sa.Column(sa.Boolean(), nullable=False, default=True)
enabled = sa.Column(sa.DateTime(), nullable=True, doc="""
This will either be the date/time when the probe was most recently enabled,
or null if it is not currently enabled. If set, the client will be
expected to take readings for this probe, and the server will monitor them
to ensure they are within the expected range etc.
""")
critical_temp_max = sa.Column(sa.Integer(), nullable=False, doc="""
Maximum high temperature; when a reading is greater than or equal to this