Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ems_collector
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZZH
ems_collector
Commits
a6378938
Commit
a6378938
authored
May 21, 2026
by
ZZH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opt ems data 2026-5-21 15:49
parent
9e291eec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
319 additions
and
77 deletions
+319
-77
constants.py
src/ems_water_grp/constants.py
+304
-75
ems.py
src/ems_water_grp/ems.py
+15
-2
No files found.
src/ems_water_grp/constants.py
View file @
a6378938
This diff is collapsed.
Click to expand it.
src/ems_water_grp/ems.py
View file @
a6378938
...
...
@@ -154,6 +154,8 @@ class WaterGrpClient:
fields
=
[]
for
node
in
resp
.
get
(
"data"
,
[]):
if
equip_id
==
2689
:
print
(
"node"
,
node
)
code
=
node
.
get
(
"parameterBriefCode"
)
if
code
:
fields
.
append
(
code
)
...
...
@@ -194,6 +196,9 @@ class WaterGrpClient:
try
:
fields
=
await
self
.
fetch_dev_fields
(
site_id
,
equip_id
,
headers
)
if
equip_id
==
2689
:
print
(
"fields"
,
fields
)
except
Exception
as
e
:
logger
.
error
(
f
"fetch {equip_name} fields fail, {e}"
)
continue
...
...
@@ -324,7 +329,7 @@ class WaterGrpService:
# await self.main_loop()
scheduler
=
AsyncIOScheduler
()
scheduler
.
add_job
(
self
.
sync_once_data
,
CronTrigger
(
second
=
"
2
"
))
scheduler
.
add_job
(
self
.
sync_once_data
,
CronTrigger
(
second
=
"
4
"
))
scheduler
.
start
()
logger
.
info
(
"Scheduler started, job aligned to 2nd of every minute"
)
...
...
@@ -352,7 +357,15 @@ async def tools():
"equipmentType"
:
221
,
"briefCodeList"
:
list
(
FIELD_MAP
[
221
]
.
keys
())
}
pyd
=
{
# 电池簇
"siteId"
:
185
,
"equipmentCode"
:
"SESBMS00003"
,
"equipmentType"
:
244
,
"briefCodeList"
:
[
"StChargEng"
,
"StDischargEng"
,
"StCap"
,
"TotalVoltage"
]
}
pyd
,
rlt
=
await
api_client
.
fetch_realtime
(
pyd
)
print
(
"rlt"
,
rlt
)
rlt
=
transfer_realtime
(
pyd
,
rlt
)
print
(
rlt
)
...
...
@@ -368,6 +381,6 @@ async def main():
if
__name__
==
"__main__"
:
logger
.
info
(
"水务集团采集服务 (基于 httpx) 正在启动..."
)
try
:
asyncio
.
run
(
main
())
asyncio
.
run
(
tools
())
except
KeyboardInterrupt
:
logger
.
info
(
"进程被用户手动终止。"
)
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