projects
/
eg5120
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9aa597b
)
added s_all to display count (and bettery) for all sensors
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 1 Jul 2023 16:30:30 +0000
(18:30 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 1 Jul 2023 16:30:30 +0000
(18:30 +0200)
views.sql
patch
|
blob
|
history
diff --git
a/views.sql
b/views.sql
index
0c63c8e
..
311565c
100644
(file)
--- a/
views.sql
+++ b/
views.sql
@@
-1,3
+1,16
@@
+drop view s_all;
+create view s_all as
+select time AT TIME ZONE 'UTC-2' as time,
+ addr,
+ (json->'sensor_type')::int as sensor_type,
+ (json->'sensor_name')::text as sensor_name,
+ (json->>'battery')::float as bettery,
+ (json->>'battery_percent')::float as battery_percent,
+ (json->'counter')::int as counter
+from eg5120
+;
+grant select on s_all to gread ;
+
-- 1 Temperature/Humidity
drop view s_1;
create view s_1 as