updating readme, fixing small bugs, adding back timer as debug log message, and updated lockfile, new screenshot #14

Merged
ben merged 12 commits from whatwhere into main 2023-02-01 08:17:16 +00:00
4 changed files with 635 additions and 531 deletions

View File

@ -6,12 +6,32 @@
[![matrix](https://git.sudo.is/ben/infra/media/branch/main/docs/img/shields/darkroom.svg)](https://matrix.to/#/#darkroom:sudo.is)
[![BSD-3-Clause-No-Military-License](docs/img/shields/license-BSD-blue.svg)](LICENSE)
this is a home monitoring system written in python and using
[zmq](https://www.zeromq.org).
this is a home monitoring system written in Python and using
[ZeroMQ](https://www.zeromq.org).
_NOTE: this project will be renamed, most likely to `roomie`._
![sudoisbot in grafna](docs/img/sudoisbot-grafana.png)
![sudoisbot in grafna](docs/img/scrot.png)
## FAQ: why zmq? dont you know about mqtt?
because i wanted a project to learn zeromq. i am aware of mqtt and
that it is designed for things like this.
## what is running where?
as this project hasnt been actively worked on for a while, things have
drifted a little bit. here are some notes for myself.
* the sensors are _most likely_ running on commit
52462cb3d9cee0fc68b7cc908ffe86e95d746bc5 (tagged as
`prod-sensors`).
* the `sink` component **was** running on commit
c5e9d2b4124edb97bbade79a70dfada9080511d5 (also tagged as
`prod-sink` and branched as `prod-sink` as well).
**this is no longer true**, sink is running off the `main` branch as of commit 0287dc196914efba4407908e020c146b1733e7ac
## related projects

BIN
docs/img/scrot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

1135
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -59,7 +59,7 @@ class ScreenPublisher(Publisher):
def align_center(self, msg, postprefixlen=0):
adjusted_halfway = self.halfway - postprefixlen
if len(msg) >= adjusted_halfway*2:
logger.warning("msg '{msg}' is too long, {len(msg)} chars.")
logger.warning(f"msg '{msg}' is too long, {len(msg)} chars.")
msg_padding = max(adjusted_halfway - (len(msg) // 2), 0)
return " "*msg_padding + msg
@ -96,7 +96,10 @@ class ScreenPublisher(Publisher):
shortname = a.replace('room', 'r')
try:
t0 = time.time()
result = Temperatures.get_last(a)
t1 = time.time() - t0
logger.debug(f"query for: {t1:.3f}s, name='{a}'")
tempstr = f"{result.temp:.1f}"
if result.temp < 10.0:
tempstr = " " + tempstr