You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thank a lot for sun2000_modbus.
I am using it with Python 3.9, so in sun2000_modbus/datatypes.py I had to replace the match/case/case... by if/elif/elif.../else in decode().
I also found very convenient to modify sun2000_modbus/inverter.py in order to benefit from the locale formatting in read_formatted(). To achieve this goal, I modified it in the following way:
defread_formatted(self, register, use_locale=False): # added the argument use_locale# (...)ifregister.value.unitisnotNone:
ifuse_locale:
returnf'{value:n}{register.value.unit}'# added the :n to format according to the locale's thousand separator, decimal signelse:
returnf'{value}{register.value.unit}'# (...)
Maybe you could consider worth to include these modifications in your sources.
The text was updated successfully, but these errors were encountered:
Hi @hchiper, thanks for your contribution.
What do you think about creating a Pull Request containing your changes?
After a review I could simply merge it and create a new release.
First, thank a lot for sun2000_modbus.
I am using it with Python 3.9, so in sun2000_modbus/datatypes.py I had to replace the match/case/case... by if/elif/elif.../else in decode().
I also found very convenient to modify sun2000_modbus/inverter.py in order to benefit from the locale formatting in read_formatted(). To achieve this goal, I modified it in the following way:
Maybe you could consider worth to include these modifications in your sources.
The text was updated successfully, but these errors were encountered: