Commit a38006df8f55353a874aaf2d485e73f0b010731a

Authored by Patrick Maeght
1 parent 9e82d12e
Exists in dev

play meteo log

simulators/plc/meteo_worker.py
... ... @@ -99,6 +99,7 @@ class WorkerThread(threading.Thread):
99 99 moment = datetime.fromtimestamp(float(line[1]))
100 100 # update message structure
101 101 print(str(moment)+ ' '+ line[2]+ ' '+ line[4]+ ' '+ line[6]+ ' '+ line[7]+ ' '+ line[8])
  102 + # resultat = get_device_attribute_value("WXT520","14656423"","OutsideTemp")
102 103 self.msg_struct['device'][0]['values'][0]['value'] = line[2]
103 104 if line[7] != "0.0":
104 105 self.rain = True
... ...
simulators/plc/run_meteo.py
... ... @@ -7,7 +7,7 @@ from simulators.plc.meteo_worker import WorkerState, WorkerThread
7 7 status = {
8 8 "name": "STATUS", "from": "Beckhoff", "version_firmware": "20170809", "site": "OSM-Mexico",
9 9 "date": "2017-03-03T13:45:00",
10   - "device": [{"name": "WXT520", "type": "meteo", "serial_number": "14656423", "valid": "yes",
  10 + "devices": [{"name": "WXT520", "type": "meteo", "serial_number": "14656423", "valid": "yes",
11 11 "values": [
12 12 {"name": "OutsideTemp", "value": 12.12, "unit": "Celcius", "comment": ""},
13 13 {"name": "OutsideHumidity", "value": 64.1, "unit": "percent", "comment": ""},
... ...
src/monitoring/test_plc_checker.py 0 → 100644
... ... @@ -0,0 +1,4 @@
  1 +
  2 +
  3 +import json
  4 +
... ...