Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
co2-mt8057s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
co2-mt8057s
Commits
963ec115
Commit
963ec115
authored
Dec 16, 2025
by
Ivan Mazhukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
just import…
just import
https://gitlab.eterfund.ru/Gendalf4ever/co2/-/archive/co2-101/co2-co2-101.tar
to co2-mt8057s subdir with rpmgs script
parent
5b6c20d0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
.gitignore
co2-mt8057s/.gitignore
+1
-0
gitignore
co2-mt8057s/gitignore
+0
-4
influxConnection.py
co2-mt8057s/influxConnection.py
+18
-7
No files found.
co2-mt8057s/.gitignore
0 → 100644
View file @
963ec115
creds.env
co2-mt8057s/gitignore
deleted
100644 → 0
View file @
5b6c20d0
config.ini
*.pyc
__pycache__/
\ No newline at end of file
co2-mt8057s/influxConnection.py
View file @
963ec115
from
influxdb
import
InfluxDBClient
from
influxdb
import
InfluxDBClient
import
os
from
dotenv
import
load_dotenv
import
time
import
time
#Загрузка файла с переменными окружения
load_dotenv
(
'creds.env'
)
#Проверка
print
(
"INFLUXDB_URL:"
,
os
.
getenv
(
'INFLUXDB_URL'
))
print
(
"INFLUXDB_DB:"
,
os
.
getenv
(
'INFLUXDB_DB'
))
class
InfluxConnection
:
class
InfluxConnection
:
def
__init__
(
self
):
def
__init__
(
self
):
#
Конфиги
#
Получение конфигурации из переменных окружения
self
.
INFLUXDB_URL
=
'http://influxdb.k8s.eterfund.ru'
self
.
INFLUXDB_URL
=
os
.
getenv
(
'INFLUXDB_URL'
)
self
.
INFLUXDB_DB
=
''
self
.
INFLUXDB_DB
=
os
.
getenv
(
'INFLUXDB_DB'
)
self
.
INFLUXDB_USER
=
''
self
.
INFLUXDB_USER
=
os
.
getenv
(
'INFLUXDB_USER'
)
self
.
INFLUXDB_PASSWORD
=
''
self
.
INFLUXDB_PASSWORD
=
os
.
getenv
(
'INFLUXDB_PASSWORD'
)
# Разделение URL на хост и порт
# Разделение URL на хост и порт
url_parts
=
self
.
INFLUXDB_URL
.
split
(
'://'
)[
1
]
.
split
(
':'
)
url_parts
=
self
.
INFLUXDB_URL
.
split
(
'://'
)[
1
]
.
split
(
':'
)
...
@@ -23,7 +36,6 @@ class InfluxConnection:
...
@@ -23,7 +36,6 @@ class InfluxConnection:
database
=
self
.
INFLUXDB_DB
database
=
self
.
INFLUXDB_DB
)
)
def
write_data
(
self
,
sensor_id
,
values
):
def
write_data
(
self
,
sensor_id
,
values
):
json_body
=
[
json_body
=
[
{
{
...
@@ -43,4 +55,3 @@ class InfluxConnection:
...
@@ -43,4 +55,3 @@ class InfluxConnection:
def
__del__
(
self
):
def
__del__
(
self
):
self
.
client
.
close
()
self
.
client
.
close
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment