From 7b9cde5f74053dbf9ae9631ec02b146e9b33f0d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20=C3=96hrstr=C3=B6m?= Date: Sun, 28 Nov 2021 18:49:08 +0100 Subject: [PATCH] Added test for qsmoke. --- simulations/simulation_t1.txt | 5 +++++ src/meter_qsmoke.cc | 5 ++++- tests/test_listen_to_all.sh | 5 +++++ tests/test_t1_meters.sh | 3 ++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/simulations/simulation_t1.txt b/simulations/simulation_t1.txt index 94e73f2..ce44947 100644 --- a/simulations/simulation_t1.txt +++ b/simulations/simulation_t1.txt @@ -297,3 +297,8 @@ telegram=|2E44B05C82340100021B7A460000002F2F0A6601020AFB1A570602FD971D00002F2F2F telegram=|3C449344957002372337725880226793442304DC0000200C05043900004C0500000000426C9F2CCC080551070000C2086CBE29326CFFFF046D280DB62A| {"media":"heat","meter":"qheat","name":"QHeato","id":"67228058","total_energy_consumption_kwh":390.4,"last_month_date":"2021-09-30 00:00","last_month_energy_consumption_kwh":75.1,"las_year_date":"2020-12-31 00:00","last_year_energy_consumption_kwh":0,"device_date_time":"2021-10-22 13:40","device_error_date":"2127-15-31 00:00","timestamp":"1111-11-11T11:11:11Z"} |QHeato;67228058;390.400000;2021-09-30 00:00;75.100000;1111-11-11 11:11.11 + +# Test QSmoke smoke detector this one is not yet understood. +telegram=|3E44934486707945211A7801FD08F081027C034955230082026CFFFF81037C034C41230082036CFFFF03FD17000000326CFFFF046D0F0ABC2B02FDAC7E1100| +{"media":"smoke detector","meter":"qsmoke","name":"QSmokeo","id":"45797086","status":"WOOT","counter_int":0,"device_date_time":"2021-11-28 10:15","timestamp":"1111-11-11T11:11:11Z"} +|QSmokeo;45797086;WOOT;1111-11-11 11:11.11 diff --git a/src/meter_qsmoke.cc b/src/meter_qsmoke.cc index 6ec8c89..06889a6 100644 --- a/src/meter_qsmoke.cc +++ b/src/meter_qsmoke.cc @@ -137,6 +137,9 @@ void MeterQSmoke::processContent(Telegram *t) string MeterQSmoke::status() { + // We do not yet know how to understand the fields! + return "WOOT"; + /* string s; bool smoke = 0; if (smoke) @@ -154,5 +157,5 @@ string MeterQSmoke::status() s.pop_back(); return s; } - return "OK"; + */ } diff --git a/tests/test_listen_to_all.sh b/tests/test_listen_to_all.sh index 93e3cfb..f9902fa 100755 --- a/tests/test_listen_to_all.sh +++ b/tests/test_listen_to_all.sh @@ -332,6 +332,11 @@ Received telegram from: 37027095 type: Heat meter (0x04) ver: 0x23 driver: qheat +Received telegram from: 45797086 + manufacturer: (QDS) Qundis, Germany (0x4493) + type: Smoke detector (0x1a) + ver: 0x21 + driver: qsmoke EOF RES=$($PROG --logfile=$LOGFILE --t1 simulations/simulation_t1.txt 2>&1) diff --git a/tests/test_t1_meters.sh b/tests/test_t1_meters.sh index ba6c29e..0f6b4a3 100755 --- a/tests/test_t1_meters.sh +++ b/tests/test_t1_meters.sh @@ -63,7 +63,8 @@ METERS="MyWarmWater supercom587 12345678 NOKEY GasMeter unismart 00043094 00000000000000000000000000000000 HeatCool hydrocalm3 71727374 NOKEY TempoHygro munia 00013482 NOKEY - QHeato qheat 67228058 NOKEY" + QHeato qheat 67228058 NOKEY + QSmokeo qsmoke 45797086 NOKEY" cat simulations/simulation_t1.txt | grep '^{' > $TEST/test_expected.txt