hoggyhoggy / givenergy-modbus-async

A python library to access GivEnergy inverters via Modbus TCP on a local network, with no dependency on the GivEnergy Cloud.
Other
2 stars 2 forks source link

complete migration of commands to be a class #39

Closed divenal closed 2 months ago

divenal commented 3 months ago

As a reminder, applications should now be using commands = client.commands() rather than importing commands directly.

This transitions commands over from a collection of simple methods to a class. In the future, that class will have access to the plant (via the client) and will therefore be able to tune behaviour to match the actual system it's connected to. For now, it still hardcodes Inverter.

There should be no changes required at point of use, if I've done it right. Unless applications had done something like from commands import * so that they were able to invoke a command with the commands. prefix - in that case, they will have to introduce a commands instance to the call.