V2G-liberty / addon-v2g-liberty

A HomeAssistant-based app to optimize and automate charging of your EV. Optimisation is based on FlexMeasures schedules.
Apache License 2.0
5 stars 2 forks source link

As the appdaemon logger now only adds v2g_app and no further details … #166

Closed ArdJonker closed 2 weeks ago

ArdJonker commented 2 weeks ago

…of where the log_statement came from i added the Module, line_number and Function in a private __log method in ReservationsClient.

ToDo: Make this a generic method/function in Globals for all modules to use.

I also added missing_app_warnings: 0 to the appdaemon.yaml to get rid of (unneeded) warnings of all the classes that are no longer separate app-daemon apps.

rhpijnacker commented 2 weeks ago

Make this a generic method/function in Globals for all modules to use.

Would it make sense to start splitting "globals" into smaller modules? This module seems a bit too stuffed with all kinds of utility functions. E.g. I would look for a function like the one you added in a module called "logging.py".

Update: I took the liberty of moving this into a helper class/utility with the same functionality and updated all modules.