rrd path updated
This commit is contained in:
@@ -5,11 +5,11 @@ the readings in RRDtool databases, and serves a responsive graph dashboard.
|
||||
|
||||
## What it stores
|
||||
|
||||
The service creates `outdoor.rrd`, `wind.rrd`, `bedroom.rrd`, `study.rrd`, and
|
||||
`living.rrd`. Each has ten-minute archives for the last two weeks and six-hour
|
||||
archives covering a year. Day, two-week, and year PNG graphs are rendered on
|
||||
demand. The wind graph splits average wind into 12 colored direction bands and
|
||||
draws gusts as a line.
|
||||
The service creates `netatmo_outdoor.rrd`, `netatmo_wind.rrd`,
|
||||
`netatmo_bedroom.rrd`, `netatmo_study.rrd`, and `netatmo_living.rrd`. Each has
|
||||
ten-minute archives for the last two weeks and six-hour archives covering a
|
||||
year. Day, two-week, and year PNG graphs are rendered on demand. The wind graph
|
||||
splits average wind into 12 colored direction bands and draws gusts as a line.
|
||||
|
||||
The Outdoor module does not contain a pressure sensor, so `outdoor.rrd` combines
|
||||
its temperature/humidity with pressure from the main station. A module without
|
||||
|
||||
@@ -36,7 +36,7 @@ class RRDStore:
|
||||
def path(self, name: str) -> Path:
|
||||
if name not in SCHEMAS:
|
||||
raise KeyError(name)
|
||||
return self.folder / f"{name}.rrd"
|
||||
return self.folder / f"netatmo_{name}.rrd"
|
||||
|
||||
def ensure_all(self) -> None:
|
||||
self.folder.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
from netatmo_service.rrd import RRDStore
|
||||
|
||||
|
||||
def test_rrd_files_have_netatmo_prefix(tmp_path):
|
||||
store = RRDStore(tmp_path)
|
||||
assert store.path("outdoor") == tmp_path / "netatmo_outdoor.rrd"
|
||||
assert store.path("wind") == tmp_path / "netatmo_wind.rrd"
|
||||
Reference in New Issue
Block a user