1234567891011121314151617181920212223242526272829303132333435 |
- #!C:\Python36\python.exe
- # -*- coding: utf-8 -*-
- import json
- import random
- print("Content-Type: text/html")
- print("")
- A0 = str(random.choice([0,1]))
- A1 = str(random.choice([0,1]))
- A2 = str(random.choice([0,1]))
- A3 = str(random.choice([0,1]))
- A4 = str(random.choice([0,1]))
- A5 = str(0)
- A6 = str(random.choice([0,1]))
- A7 = str(random.choice([0,1]))
- bitmask = A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7
- JSON = {
- "AC": 218.8,
- "DC": 230.4,
- "in_freq": 50.0,
- "out_freq": 50.0,
- "pwr": 40.0,
- "line_fail": 1,
- "low_battery": 1,
- "bat_cap": 92.0,
- "inner_temp": 27.0,
- "bat_time_left": 230.0,
- "batsym": "Норма",
- "mode": "Профилактика сульфатации",
- "alarm": "5",
- "utc": "3.0",
- "netsettings_changed": "false"
- }
- print(json.dumps(JSON))
|