When a monitoring controller is started, an improper monitor function is added that is supposed to monitor the storage state.
https://github.com/dos-group/vessim/blob/5e2f94f2615ecaa6d59e5ac87e306c39c30353ac/vessim/controller.py#L61-L65
The storage_state variable is just a constant, containing the initial storage state, and so, the monitor function always returns the initial state instead of the correct current state.
A fix that causes no typing errors could look like this:
if microgrid.storage is not None:
def fn(time):
return microgrid.storage.state()
self.add_monitor_fn(fn)
When a monitoring controller is started, an improper monitor function is added that is supposed to monitor the storage state. https://github.com/dos-group/vessim/blob/5e2f94f2615ecaa6d59e5ac87e306c39c30353ac/vessim/controller.py#L61-L65 The storage_state variable is just a constant, containing the initial storage state, and so, the monitor function always returns the initial state instead of the correct current state. A fix that causes no typing errors could look like this: