-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement inverter.py own logger / Python 3.9 retro-compatibility / Restore .connected attribute #35
Commits on Apr 2, 2024
-
Retro-compatibility with python 3.9
This is a proposal to replace the `match/case/case...` by `if/elif/elif.../else` in the function `.decode()` to ensure compatibility with python 3.9 and earlier. The use of `match/case` in this function is the only place in the whole package where a construction requires python >= 3.10. The proposed modification seems worth because python 3.9 is still widely used; it is e.g. the version available in Debian/oldstable repositories, which is still supported.
Configuration menu - View commit details
-
Copy full SHA for 4b6f3f7 - Browse repository at this point
Copy the full SHA 4b6f3f7View commit details -
Reintroduce
.connected
attrubuteThis is a proposal to reintroduce the '.connected` attribute. Its suppression in recent versions of the module causes errors in programs using earlier versions. In this proposal, an equivalent is reintroduced, now as a property, relying directly on the new `.isConnected()` method.
Configuration menu - View commit details
-
Copy full SHA for 4e7ca33 - Browse repository at this point
Copy the full SHA 4e7ca33View commit details -
Merge pull request #1 from hchiper/hchiper-patch-python39
Retro-compatibility with python 3.9
Configuration menu - View commit details
-
Copy full SHA for 824bac8 - Browse repository at this point
Copy the full SHA 824bac8View commit details -
Merge pull request #2 from hchiper/hchiper-patch-connected
Reintroduce `.connected` attrubute
Configuration menu - View commit details
-
Copy full SHA for cae92f4 - Browse repository at this point
Copy the full SHA cae92f4View commit details -
Implement sun2000_modbus.inverter own logger
This proposal implements an own logger for the `sun2000_modbus.inverter` module. Before, it was using the default "root" logger. If a program using the module needed to mute its log messages, the only option was to mute the "root" logger, which also muted messages from all other loggers. A module-specific logger can be tuned without impact on other loggers and its messages will clearly display their origin as "sun2000_modbus.inverter" instead of "root". Usage examples (in a custom program): 1°) catch the logger inv_log = logging.getLogger("sun2000_modbus.inverter") 2°) use one of the following instructions inv_log.setLevel(logging.INFO) # original behaviour inv_log.setLevel(logging.ERROR) # or any other level inv_log.disabled = True # disables this logger only
Configuration menu - View commit details
-
Copy full SHA for f0f8085 - Browse repository at this point
Copy the full SHA f0f8085View commit details -
Merge pull request #3 from hchiper/hchiper-patch-logging
Implement sun2000_modbus.inverter own logger
Configuration menu - View commit details
-
Copy full SHA for 162216b - Browse repository at this point
Copy the full SHA 162216bView commit details
Commits on Apr 3, 2024
-
Number formatting according to locale
This proposal implements the formatting numbers with the proper thousand separator and decimal sign according to the locale for the `.read_formatted()` function. To use this feature, a module should at first ` import locale locale.setlocale(locale.LC_ALL, '') ` and then call `.read_formatted()` with the named parameter `use_locale` set to `True`, for example: `read_formatted(register, use_locale=True)`.
Configuration menu - View commit details
-
Copy full SHA for 74cc685 - Browse repository at this point
Copy the full SHA 74cc685View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f4f125 - Browse repository at this point
Copy the full SHA 0f4f125View commit details