added rain, updated graph styles
This commit is contained in:
+17
-1
@@ -1,11 +1,27 @@
|
||||
from netatmo_service.data import Sample
|
||||
from netatmo_service.rrd import RRDStore
|
||||
from netatmo_service.rrd import RRDStore, rainbow
|
||||
|
||||
|
||||
def test_wind_rainbow_uses_compass_angle():
|
||||
assert rainbow(0) == (0, 255, 255)
|
||||
assert rainbow(90) == (128, 0, 255)
|
||||
assert rainbow(180) == (255, 0, 0)
|
||||
assert rainbow(270) == (128, 255, 0)
|
||||
|
||||
|
||||
def test_each_wind_angle_has_an_unlabelled_color():
|
||||
drawings = RRDStore._wind_drawings()
|
||||
assert len(drawings) == 722
|
||||
assert sum(item.startswith("AREA:dir") for item in drawings) == 360
|
||||
assert not any("degrees" in item for item in drawings)
|
||||
|
||||
|
||||
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"
|
||||
assert store.path("rain") == tmp_path / "netatmo_rain.rrd"
|
||||
assert store.path("pressure") == tmp_path / "netatmo_pressure.rrd"
|
||||
|
||||
|
||||
def test_rrd_is_updated_only_once_per_collection_interval(tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user