Skip to content

Commit ab95452

Browse files
Fixed JSON bug (#44) (#45)
1 parent 983538d commit ab95452

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

CHANGES.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
=======================
22
pyMagnum Release Notes
33
=======================
4+
Version 2.0.2 2022/11/09
5+
- Fixed bug in issue #44 https://github.com/CharlesGodwin/pymagnum/issues/44
46
Version 2.0.1 2022/06/18
57
- Enhancement: Added MQTT username and password support to examples/mqttlogger.py (issue #38)
68
- Fixed bug in magtest related to PT100

magnum/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55
#
66
# BUILDINFO
7-
__version__="2.0.1"
7+
__version__="2.0.2"
88
#
99
# names of devices
1010
#

magnum/pt100device.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,21 @@ def __init__(self, trace=False):
3636
# check page 14 for fan on and Day
3737
self.data["fan_on"] = 0
3838
self.data["day"] = 0
39-
#
39+
#
4040
self.data["battery_temperature"] = 0.0
4141
self.data["inductor_temperature"] = 0.0
4242
self.data["fet_temperature"] = 0.0
4343
# Start of C2
44-
self.data["lifetime_kwhrs"] = math.nan
45-
self.data["resettable_kwhrs"] = math.nan
46-
self.data["ground_fault_current"] = math.nan
47-
self.data["nominal_battery_voltage"] = 12.0
48-
self.data["stacker_info"] = 0
49-
self.data['dip_switches'] = '00000000'
50-
self.data["model"] = ''
51-
self.data["output_current_rating"] = math.nan
52-
self.data["input_voltage_rating"] = math.nan
44+
# 2022-11-08 09:18:48 data only generated if a C2 packet is received
45+
# self.data["lifetime_kwhrs"] = math.nan
46+
# self.data["resettable_kwhrs"] = math.nan
47+
# self.data["ground_fault_current"] = math.nan
48+
# self.data["nominal_battery_voltage"] = 12.0
49+
# self.data["stacker_info"] = 0
50+
# self.data['dip_switches'] = '00000000'
51+
# self.data["model"] = ''
52+
# self.data["output_current_rating"] = math.nan
53+
# self.data["input_voltage_rating"] = math.nan
5354
# Start of C3
5455
# self.data["daily_kwh"] = math.nan
5556
# self.data["max_daily_pv_volts"] = math.nan
@@ -91,7 +92,7 @@ def parse(self, packet):
9192
self.data['alarm_state'] = (byte_value >> 1) & 0x01
9293
self.data["fan_on"] = (byte_value >> 3) & 0x01
9394
self.data["day"] = (byte_value >> 4) & 0x01
94-
95+
9596
byte_value = unpacked[10]
9697
if byte_value == 0X97 or byte_value == 0X98:
9798
self.data['battery_temperature'] = None # Short or open

0 commit comments

Comments
 (0)