diff --git a/README.md b/README.md index 8331131..72d7a6a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/netatmo_service/rrd.py b/netatmo_service/rrd.py index e774234..11c27ef 100644 --- a/netatmo_service/rrd.py +++ b/netatmo_service/rrd.py @@ -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) diff --git a/tests/test_rrd.py b/tests/test_rrd.py new file mode 100644 index 0000000..bb8858e --- /dev/null +++ b/tests/test_rrd.py @@ -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"