sunspec / pysunspec2

SunSpec Python library for interfacing with SunSpec devices.
Apache License 2.0
57 stars 21 forks source link

FileClientModel initializes FileClientGroup without proper points_class #68

Open jmmgenerac opened 2 years ago

jmmgenerac commented 2 years ago

Because the FileClientModel initializes its FileClientGroup parent class without referencing the FileClientPoint class, all points in the FileClientModel have the generic device.Point class instead of the file.client.FileClientPoint class.

One benefit of using the FileClientPoint class is that it contains a read() method, unlike the device.Point class which does not.

https://github.com/sunspec/pysunspec2/blob/642f1afeda0d7e35e9eaf36c43c3e667f2c2bce2/sunspec2/file/client.py#L54-L55 Should be:

 FileClientGroup.__init__(self, gdef=gdef, model=self, model_offset=0, group_len=self.model_len, data=data, 
                          data_offset=0, group_class=group_class, point_class=point_class)
jmmgenerac commented 2 years ago

See pull request https://github.com/sunspec/pysunspec2/pull/69