srcfl / srcful-gateway

Srcful energy gateway to connect your solar inverter and mine src-token
https://srcful.io
MIT License
3 stars 1 forks source link

Refactor and replace hard-coded strings... #194

Open davmoz opened 2 weeks ago

davmoz commented 2 weeks ago

Refactor and replace hard-coded strings with constants. Also create objects that describes common structures instead of using dictionaries.

https://github.com/srcfl/srcful-gateway/blob/main/server/web/handler/get/network.py#L89

h0bb3 commented 1 week ago

this sounds like two issues :)

I made an example of using properties instead of hard coded strings for the address handler. I think this works out pretty well and avoids some problems as a property is immutable... having no real immutable constants in python...