李莎 2 years ago
parent
commit
b9e5474d3d
2 changed files with 15 additions and 17 deletions
  1. 1 1
      config.json
  2. 14 16
      main.py

+ 1 - 1
config.json

@@ -1,7 +1,7 @@
 {
   "metadata": {
     "database": "db_time_data",
-    "url": "http://47.93.33.207:8890/metadata-web/services/Service1_WS?wsdl"
+    "url": "http://prod-metadataweb.sagacloud.cn/metadata-web-hbasecat/metadata-web/services/Service1_WS?wsdl"
   },
   "building": "1101020002",
   "dingding": "https://oapi.dingtalk.com/robot/send?access_token=f654c98a50435c95ee10ab012ba1550d8ff27d741d1484656d8e42f88a814b7c",

+ 14 - 16
main.py

@@ -30,14 +30,14 @@ def get_data_time(zillionUtil,hbase_database, hbase_table, building,meters,funci
     return datas
 
 
-# with open("config.json", "r",encoding="utf-8") as f:
-#     data = json.load(f)
-#     hbase_database = data["metadata"]["database"]
-#     url = data["metadata"]["url"]
-#     building = data["building"]
-#     funcid = data["funcid"]
-#     # points = data["points"]
-#     dingding = data["dingding"]
+with open("config.json", "r",encoding="utf-8") as f:
+    data = json.load(f)
+    hbase_database = data["metadata"]["database"]
+    url = data["metadata"]["url"]
+    building = data["building"]
+    # funcid = data["funcid"]
+    # points = data["points"]
+    dingding = data["dingding"]
 points = {'1202': 'B2南新风机房浸水报警传感器',
           '1201': '2F空调机房浸水报警传感器',
           '1203': 'B2北新风机房浸水报警传感器',
@@ -46,12 +46,12 @@ points = {'1202': 'B2南新风机房浸水报警传感器',
           '9001': '楼顶北新风机房浸水报警传感器'}
 funcid = 11701
 
-hbase_database = os.getenv("hbase_database")
-url = os.getenv("url")
-building = os.getenv("building")
-dingding = os.getenv("dingding")
-# funcid = os.getenv("funcid")
-# points = os.getenv("points")
+# hbase_database = os.getenv("hbase_database")
+# url = os.getenv("url")
+# building = os.getenv("building")
+# dingding = os.getenv("dingding")
+# # funcid = os.getenv("funcid")
+# # points = os.getenv("points")
 
 #存报警
 alarm = {}
@@ -94,5 +94,3 @@ while True:
         send_message_markdown(title,messages_info,dingding)
         messages.clear()
     time.sleep(60)
-
-