srcfl / srcful-gateway

Sourceful Energy Gateway: Connect your solar inverter or Utility meters to earn tokens.
https://sourceful.energy/
MIT License
5 stars 2 forks source link

Unified device opening endpoint #245

Closed h0bb3 closed 6 days ago

h0bb3 commented 1 week ago

In branch connected to #238 there is a unified Device opening endpoint with automatic documentation based on Connection subclasses. We should consider this as the current part is confusing and has basically the same code in them.

This requires each connection to carry its own json object for specification and also fetching these from the factory. This would mean only needing to implement the ICom and IComFactory parts when adding a new connection and no need to change the endpoint.

e.g in the following the code is basically the same: modbusTCP modbusSolarman modbusRTU

There is also a risk for a discrepancy between what is coded in the endpoints and what is actually in the ICom implementations.

h0bb3 commented 6 days ago

This should of course support post, get and delete