Skip to content

Commit

Permalink
Merge pull request #12 from sunspec/development
Browse files Browse the repository at this point in the history
1.0.2 Update
  • Loading branch information
bobfox authored Nov 5, 2020
2 parents 09806d0 + f7021e6 commit d6023c3
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "sunspec2/models"]
path = sunspec2/models
url = https://github.com/sunspec/models.git
branch = development
branch = master
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='pysunspec2',
version='1.0.1',
version='1.0.2',
description='Python SunSpec Tools',
author='SunSpec Alliance',
author_email='support@sunspec.org',
Expand Down
2 changes: 1 addition & 1 deletion sunspec2/models
26 changes: 13 additions & 13 deletions sunspec2/tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ def test_get_mb(self):
},
{
"V": 10700,
"Var": 3000
"Var": -3000
}
]
},
Expand Down Expand Up @@ -1999,7 +1999,7 @@ def test_get_mb(self):
},
{
"V": 10600,
"Var": 4000
"Var": -4000
}
]
},
Expand Down Expand Up @@ -2027,24 +2027,24 @@ def test_get_mb(self):
},
{
"V": 10800,
"Var": 2000
"Var": -2000
}
]
}
]
}
m = device.Model(705, data=gdata_705)
assert m.groups['Crv'][0].get_mb() == b'\x00\x04\x00\x01\x00\x01\x00\x01\x00\x00\xff\xff\xff\xff\x00\x00\x00' \
b'\x06\x00\x01#\xf0\x0b\xb8%\xc6\x00\x00(<\x00\x00)\xcc\x0b\xb8'
assert m.groups['Crv'][0].get_mb() == b'\x00\x04\x00\x01\x00\x01\x00\x01\x00\x00\xff\xff\xff\xff\x00\x00' \
b'\x00\x06\x00\x01#\xf0\x0b\xb8%\xc6\x00\x00(<\x00\x00)\xcc\xf4H'

# test computed
m.groups['Crv'][0].points['DeptRef'].sf_required = True
m.groups['Crv'][0].points['DeptRef'].sf_value = 3
m.groups['Crv'][0].points['Pri'].sf_required = True
m.groups['Crv'][0].points['Pri'].sf_value = 3
assert m.groups['Crv'][0].get_mb(computed=True) == b'\x00\x04\x03\xe8\x03\xe8\x00\x01\x00\x00\xff\xff' \
b'\xff\xff\x00\x00\x00\x06\x00\x01\x00\\\x00\x1e\x00`' \
b'\x00\x00\x00g\x00\x00\x00k\x00\x1e'
assert m.groups['Crv'][0].get_mb(computed=True) == b'\x00\x04\x03\xe8\x03\xe8\x00\x01\x00\x00\xff\xff\xff' \
b'\xff\x00\x00\x00\x06\x00\x01\x00\\\x00\x1e\x00`\x00\x00' \
b'\x00g\x00\x00\x00k\xff\xe2'

def test_set_mb(self):
gdata_705 = {
Expand Down Expand Up @@ -2085,7 +2085,7 @@ def test_set_mb(self):
},
{
"V": 10700,
"Var": 3000
"Var": -3000
}
]
},
Expand Down Expand Up @@ -2113,7 +2113,7 @@ def test_set_mb(self):
},
{
"V": 10600,
"Var": 4000
"Var": -4000
}
]
},
Expand Down Expand Up @@ -2141,15 +2141,15 @@ def test_set_mb(self):
},
{
"V": 10800,
"Var": 2000
"Var": -2000
}
]
}
]
}
m = device.Model(705, data=gdata_705)
assert m.groups['Crv'][0].get_mb() == b'\x00\x04\x00\x01\x00\x01\x00\x01\x00\x00\xff\xff\xff\xff\x00' \
b'\x00\x00\x06\x00\x01#\xf0\x0b\xb8%\xc6\x00\x00(<\x00\x00)\xcc\x0b\xb8'
assert m.groups['Crv'][0].get_mb() == b'\x00\x04\x00\x01\x00\x01\x00\x01\x00\x00\xff\xff\xff\xff\x00\x00' \
b'\x00\x06\x00\x01#\xf0\x0b\xb8%\xc6\x00\x00(<\x00\x00)\xcc\xf4H'

bs = b'\x00\x04\x03\xe7\x03x\x03\t\x02\x9a\x02+\x01\xbc\x01M\x00\xde\x00o' \
b'\x00\xde\x01M\x01\xbc\x02+\x02\x9a\xfc\xf7\xf4H\x0b\xb8'
Expand Down
Loading

0 comments on commit d6023c3

Please sign in to comment.