Skip to content

Commit

Permalink
Correct encoding of GrowattConfigResponse.config_value and associated…
Browse files Browse the repository at this point in the history
… test case
  • Loading branch information
aaronjbrown committed May 2, 2021
1 parent e748cdb commit a9a155a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion PyGrowatt/Growatt.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ def encode(self):
self.wifi_serial,
self.config_id,
self.config_length,
self.config_value)
self.config_value.encode('UTF-8'))

return data

def decode(self, data):
Expand Down
2 changes: 1 addition & 1 deletion test/test_Growatt.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def test_encode(self):
response = Growatt.GrowattConfigResponse(wifi_serial=b'ABC1D2345E',
config_id=31,
config_length=19,
config_value=b'2020-12-20 00:33:57')
config_value='2020-12-20 00:33:57')
data = response.encode()

self.assertEqual(binascii.hexlify(_xor(data)),
Expand Down

0 comments on commit a9a155a

Please sign in to comment.