-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from airalab/dev
v.1.6.4
- Loading branch information
Showing
9 changed files
with
116 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
from .database import DataBase | ||
|
||
class DatalogDB: | ||
def __init__(self, path_to_db_file: str) -> None: | ||
self.db_class = DataBase(path_to_db_file, "datalog") | ||
|
||
def create_table(self) -> None: | ||
self.db_class.create_table("id integer PRIMARY KEY, status text, hash text, time real, payload blob") | ||
|
||
def add_data(self, status, hash, time, payload) -> None: | ||
self.db_class.insert_data("status, hash, time, payload", (status, hash, time, payload)) | ||
|
||
def update_status(self, status, hash) -> None: | ||
self.db_class.update("SET status = ? WHERE hash = ?", (status, hash)) | ||
|
||
def checker(self, current_time) -> list: | ||
time = current_time - 86400 # 24hrs | ||
hashes = self.db_class.get_data("hash", "WHERE time < ? AND status='not sent'", (time,)) | ||
self.db_class.delete_data("WHERE status='sent'") | ||
return hashes | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from .database import DataBase | ||
|
||
|
||
class IPFSDB: | ||
def __init__(self, path_to_db_file: str) -> None: | ||
self.db_class = DataBase(path_to_db_file, "ipfs") | ||
|
||
def create_table(self) -> None: | ||
self.db_class.create_table("id integer PRIMARY KEY, status text, hash text") | ||
|
||
def add_hash(self, hash: str) -> None: | ||
status = "pinned" | ||
self.db_class.insert_data("status, hash", (status, hash)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "sensors_connectivity" | ||
version = "1.6.3" | ||
version = "1.6.4" | ||
description = "Robonomics package to read data from sensors and publish to different output channels" | ||
authors = [ | ||
"Vadim Manaenko <[email protected]>", | ||
|
@@ -25,7 +25,7 @@ pyserial = "^3.5" | |
pynacl = "^1.5.0" | ||
pyyaml = "^6.0" | ||
requests = "^2.27.1" | ||
sentry_sdk = "^1.1.5" | ||
sentry_sdk = "2.8.0" | ||
robonomics-interface = "^1.6.0" | ||
ipfshttpclient = "0.8.0a2" | ||
pinatapy-vourhey = "^0.1.3" | ||
|