pymscada 0.1.8__py3-none-any.whl → 0.1.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pymscada might be problematic. Click here for more details.

pymscada/bus_client.py CHANGED
@@ -109,7 +109,7 @@ class BusClient:
109
109
  self.ip, self.port)
110
110
  self.addr = self.writer.get_extra_info('sockname')
111
111
  self.write(pc.CMD_LOG, 0, 0, f'{self.module} connected'.encode())
112
- logging.info(f'connected {self.addr}')
112
+ logging.warning(f'connected {self.addr} {self.port}')
113
113
  for tag in Tag.get_all_tags().values():
114
114
  self.add_tag(tag)
115
115
  Tag.set_notify(self.add_tag)
@@ -29,6 +29,7 @@ class AccuWeatherClient:
29
29
  for x in api['locations'].values()]
30
30
  self.session = aiohttp.ClientSession()
31
31
  self.queue = asyncio.Queue()
32
+ self.init_run = True
32
33
 
33
34
  async def handle_response(self):
34
35
  """Unpack the weather values from the json response."""
@@ -41,7 +42,7 @@ class AccuWeatherClient:
41
42
  for record in json:
42
43
  epoch = record['EpochDateTime']
43
44
  hour = int((epoch - time_mod) / 3600)
44
- logging.warning(f'epoch {epoch} time_s {time_s} hour {hour}')
45
+ logging.info(f'epoch {epoch} time_s {time_s} hour {hour}')
45
46
  if hour not in self.api['times']:
46
47
  continue
47
48
  suffix = ''
@@ -54,26 +55,32 @@ class AccuWeatherClient:
54
55
  ['Rain', 'Rain', None, 'Value'],
55
56
  ['Snow', 'Snow', None, 'Value']
56
57
  ]:
57
- tag = self.tags[f'{site}{parm}{suffix}']
58
+ tagname = f'{site}{parm}{suffix}'
59
+ tag = self.tags[tagname]
58
60
  if key2 is None:
59
61
  value = record[key1][key]
60
62
  else:
61
63
  value = record[key1][key2][key]
64
+ logging.info(f'{tagname} was {tag.value} new {value}')
62
65
  if tag.value != value:
63
66
  tag.value = value, int(epoch * 1e6), self.map_bus
64
67
 
65
68
  async def fetch_data(self, location, url, query):
66
69
  """HTTP get."""
67
70
  logging.warning(f'poll {location} {url}')
68
- async with self.session.get(url, params=query,
69
- proxy=self.proxy) as resp:
70
- self.queue.put_nowait([location, await resp.json()])
71
+ try:
72
+ async with self.session.get(url, params=query,
73
+ proxy=self.proxy) as resp:
74
+ self.queue.put_nowait([location, await resp.json()])
75
+ except asyncio.TimeoutError as e:
76
+ logging.warning('AccuWeather {e}')
71
77
 
72
78
  async def poll(self):
73
79
  """Poll the weather site near the start of each hour."""
74
80
  now = int(time())
75
- if now % 3600 != 120:
81
+ if now % 3600 != 120 and not self.init_run:
76
82
  return
83
+ self.init_run = False
77
84
  if not self.queue.empty():
78
85
  return
79
86
  # Get the weather forecasts
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymscada
3
- Version: 0.1.8
3
+ Version: 0.1.10
4
4
  Summary: Shared tag value SCADA with python backup and Angular UI
5
5
  Author-Email: Jamie Walton <jamie@walton.net.nz>
6
6
  License: GPL-3.0-or-later
@@ -1,10 +1,10 @@
1
- pymscada-0.1.8.dist-info/METADATA,sha256=AhhiEVdfw41cvNcNOaYMV5EOwuYF4_RD6zbULAu7HmA,2205
2
- pymscada-0.1.8.dist-info/WHEEL,sha256=rSwsxJWe3vzyR5HCwjWXQruDgschpei4h_giTm0dJVE,90
3
- pymscada-0.1.8.dist-info/entry_points.txt,sha256=AcZZ7HFj8k1ztP6ge-5bdRinYF8glW2s6lFEQG3esN4,57
4
- pymscada-0.1.8.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
1
+ pymscada-0.1.10.dist-info/METADATA,sha256=dlflj5d4bt0yUjw48_ZG2nPXcIdwJpj6kH2AEMQg4TA,2206
2
+ pymscada-0.1.10.dist-info/WHEEL,sha256=Vza3XR51HW1KmFP0iIMUVYIvz0uQuKJpIXKYOBGQyFQ,90
3
+ pymscada-0.1.10.dist-info/entry_points.txt,sha256=j_UgZmqFhNquuFC2M8g5-8X9FCpp2RaDb7NrExzkj1c,72
4
+ pymscada-0.1.10.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
5
5
  pymscada/__init__.py,sha256=NV_cIIwe66Ugp8ns426rtfJIIyskWbqwImD9p_5p0bQ,739
6
6
  pymscada/__main__.py,sha256=WcyVlrYOoDdktJhOoyubTOycMwpayksFdxwelRU5xpQ,272
7
- pymscada/bus_client.py,sha256=PncKysSCWhcpCPTVq9kkfb4NOjds7bZBwH7jaLHX3nI,8884
7
+ pymscada/bus_client.py,sha256=NWumdtLNy4-_LdTumHy687q0ebQX7fdynSp13dZgpYo,8899
8
8
  pymscada/bus_server.py,sha256=3ZLT2QFfKMndrTVd1TRWk15rYtaXnW1Ls2dlZe5nsyM,11544
9
9
  pymscada/checkout.py,sha256=N8ZIxtNaP87w2cVRBGA2ib1cijdFfF4xWWZFFVLJa9g,3494
10
10
  pymscada/config.py,sha256=vwGxieaJBYXiHNQEOYVDFaPuGmnUlCnbNm_W9bugKlc,1851
@@ -39,7 +39,7 @@ pymscada/demo/wwwserver.yaml,sha256=MhZbvnxAfkc3OutXyZVaVKif4ZD9VSch5NfBbO0T_-E,
39
39
  pymscada/files.py,sha256=FSEvFs6gNgErx_B7mtWkt6EsGNSc-TlxEbDW59NxIZs,2439
40
40
  pymscada/history.py,sha256=G079gHfzasmGtI5ANS8MdETD4bdZg5vHE_yTKk7atHw,9504
41
41
  pymscada/iodrivers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
- pymscada/iodrivers/accuweather.py,sha256=nzpqXYus1eJri1QFwBYFoYmR9s6bK5oq4qdz0yY9fg8,3537
42
+ pymscada/iodrivers/accuweather.py,sha256=p_OYJtCrtbSQYjgf06Yk3Qc9wGpkx8ogn81XNGd19fE,3842
43
43
  pymscada/iodrivers/logix_client.py,sha256=eqmiYLYUBHbr7wTljomGIZVNvXe-5WleGKfzwcHXO8w,2829
44
44
  pymscada/iodrivers/logix_map.py,sha256=ljjBAMJcw199v1V5u0Yfl38U6zbZzba5mdY4I3ZvdIM,5401
45
45
  pymscada/iodrivers/modbus_client.py,sha256=DIGrEPz_Bwwj9CEeog5fQqiAu1UMV7xVL6KxlKgXNPs,9592
@@ -63,4 +63,4 @@ pymscada/tools/snmp_client2.py,sha256=pdn5dYyEv4q-ubA0zQ8X-3tQDYxGC7f7Xexa7QPaL4
63
63
  pymscada/tools/walk.py,sha256=OgpprUbKLhEWMvJGfU1ckUt_PFEpwZVOD8HucCgzmOc,1625
64
64
  pymscada/validate.py,sha256=VPpAVEwfgori5OREEwWlbPoPxz5Tfqr6dw-O5pINHyI,13125
65
65
  pymscada/www_server.py,sha256=LzkT1DiKq6ql66MPncHefYU3qgoi9HxoYLETjjTMNvY,12024
66
- pymscada-0.1.8.dist-info/RECORD,,
66
+ pymscada-0.1.10.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: pdm-backend (2.3.3)
2
+ Generator: pdm-backend (2.4.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,3 +1,5 @@
1
1
  [console_scripts]
2
2
  pymscada = pymscada.__main__:cmd_line
3
3
 
4
+ [gui_scripts]
5
+