Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into NEW_cli_parse_report
Browse files Browse the repository at this point in the history
  • Loading branch information
tinogis committed Dec 24, 2024
2 parents 2b81c3b + fe9c519 commit 92f35eb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[bumpversion]
current_version = 1.53.1
current_version = 1.53.5
4 changes: 3 additions & 1 deletion primestg/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
'powers': {'order': 'B02', 'func': 'get_powers'},
'dlms': {'order': 'B12', 'func': 'order_raw_dlms'},
# CNC config
'cnc_ftpip': {'order': 'B07', 'func': 'set_concentrator_ipftp'}
'cnc_ftpip': {'order': 'B07', 'func': 'set_concentrator_ip'},
'cnc_ftpntp': {'order': 'B07', 'func': 'set_concentrator_ip'},
'cnc_ftpstg': {'order': 'B07', 'func': 'set_concentrator_ip'},
}


Expand Down
5 changes: 5 additions & 0 deletions primestg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def octet2date(txt):
elif year == 0:
hexadecimal = False
year = 0000
elif year < 100:
hexadecimal = False
year = int(txt[0:4]) + 2000
month = hexadecimal and octet2number(txt[4:6]) or int(txt[4:6])
if month < 1 or month > 12:
month = 1
Expand All @@ -98,6 +101,8 @@ def octet2date(txt):
hour = 0
else:
hour = hexadecimal and octet2number(hour_txt) or int(hour_txt)
if int(hour_txt) > 23:
hour = 0
minute_txt = txt[10:12]
if minute_txt == 'FF':
minute = 0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='primestg',
version='1.53.1',
version='1.53.5',
packages=find_packages(),
url='https://github.com/gisce/primestg',
license='GNU Affero General Public License v3',
Expand Down
5 changes: 4 additions & 1 deletion spec/utils_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@
"FFFF1225000000000W": datetime(9999, 12, 25, 0, 0, 0),
#wrong month
"21110021000000000W": datetime(2111, 1, 21, 0, 0, 0),
"00021130000000000W": datetime(2002, 11, 30, 0, 0, 0),
# wrong year
"00001228230000000W": "time data '0-12-28 23:0:0' does not match format '%Y-%m-%d %H:%M:%S'"
"3022002094010020FF800009": datetime(3022, 1, 20, 0, 1, 0),
"00001228230000000W": "time data '0-12-28 23:0:0' does not match format '%Y-%m-%d %H:%M:%S'",

}
for octet, dt in dates.items():
if isinstance(dt, six.string_types):
Expand Down

0 comments on commit 92f35eb

Please sign in to comment.