bluemaestro: include humidity, pressure and dewpoint data

This commit is contained in:
Dima Gerasimov 2020-10-05 20:21:47 +01:00 committed by karlicoss
parent ced93e6942
commit 90ada92110
3 changed files with 38 additions and 19 deletions

View file

@ -1,6 +1,10 @@
#!/usr/bin/env python3
from pathlib import Path
from more_itertools import one
import pytest # type: ignore
def test() -> None:
from my.bluemaestro import measurements
@ -20,7 +24,20 @@ def test() -> None:
assert len(res) < 6000
import pytest # type: ignore
@pytest.mark.skip(reason='todo add old database to the testdata')
def test_old_db() -> None:
from my.bluemaestro import measurements
res = list(measurements())
r1 = one(x for x in res if x.dt.strftime('%Y%m%d %H:%M:%S') == '20181003 09:07:00')
r2 = one(x for x in res if x.dt.strftime('%Y%m%d %H:%M:%S') == '20181003 09:19:00')
assert r1.temp == 16.8
assert r2.temp == 18.3
assert r1.pressure == 1025.8
assert r2.pressure == 1009.9
@pytest.fixture(autouse=True)
def prepare():
testdata = Path(__file__).absolute().parent.parent / 'testdata'