Skip to content

Commit 489d50b

Browse files
authored
Write INFO logs for components transitioning to WORKING state (frequenz-floss#1277)
2 parents 0fe1a22 + f207266 commit 489d50b

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

RELEASE_NOTES.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,16 @@
22

33
## Summary
44

5-
This release provides an experimental, opt-in, time-jumps resilient resampler, that can be enabled by using the new `ResamplerConfig2` class.
5+
<!-- Here goes a general summary of what this release is about -->
66

77
## Upgrading
88

9-
* The resampling function now takes plain `float`s as values instead of `Quantity` objects.
10-
* `frequenz.sdk.timeseries.UNIX_EPOCH` was removed, use [`frequenz.core.datetime.UNIX_EPOCH`](https://frequenz-floss.github.io/frequenz-core-python/latest/reference/frequenz/core/datetime/#frequenz.core.datetime.UNIX_EPOCH) instead.
9+
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
1110

1211
## New Features
1312

14-
- A new configuration mode was added to the resampler (and thus the resampling actor and microgrid high-level interface). When passing a new `ResamplerConfig2` instance to the resampler, it will use a wall clock timer instead of a monotonic clock timer. This timer adjustes sleeps to account for drifts in the monotonic clock, and thus allows for more accurate resampling in cases where the monotonic clock drifts away from the wall clock. The monotonic clock timer option will be deprecated in the future, as it is not really suitable for resampling. The new `ResamplerConfig2` class accepts a `WallClockTimerConfig` to fine-tune the wall clock timer behavior, if necessary.
15-
16-
Example usage:
17-
18-
```python
19-
from frequenz.sdk import microgrid
20-
from frequenz.sdk.timeseries import ResamplerConfig2
21-
22-
await microgrid.initialize(
23-
MICROGRID_API_URL,
24-
# Just replace the old `ResamplerConfig` with the new `ResamplerConfig2`
25-
resampler_config=ResamplerConfig2(resampling_period=timedelta(seconds=1.0)),
26-
)
27-
```
13+
<!-- Here goes the main new features and examples or instructions on how to use them -->
2814

2915
## Bug Fixes
3016

31-
- When using the new wall clock timer in the resampmler, it will now resync to the system time if it drifts away for more than a resample period, and do dynamic adjustments to the timer if the monotonic clock has a small drift compared to the wall clock.
32-
33-
- A power distributor logging issue is fixed, that was causing the power for multiple batteries connected to the same inverter to be reported incorrectly.
17+
- The log level for when components are transitioning to a `WORKING` state is lowered to `INFO`, and the log message has been improved.

src/frequenz/sdk/microgrid/_power_distributing/_component_status/_ev_charger_status_tracker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def _handle_ev_data(self, ev_data: EVChargerData) -> ComponentStatusEnum:
115115

116116
if self._is_working(ev_data):
117117
if self._last_status == ComponentStatusEnum.NOT_WORKING:
118-
_logger.warning(
119-
"EV charger %s is in WORKING state.",
118+
_logger.info(
119+
"EV charger %s: state changed to WORKING.",
120120
self._component_id,
121121
)
122122
return ComponentStatusEnum.WORKING

src/frequenz/sdk/microgrid/_power_distributing/_component_status/_pv_inverter_status_tracker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def _handle_pv_inverter_data(self, pv_data: InverterData) -> ComponentStatusEnum
125125

126126
if self._is_working(pv_data):
127127
if self._last_status == ComponentStatusEnum.NOT_WORKING:
128-
_logger.warning(
129-
"PV inverter %s is in WORKING state.",
128+
_logger.info(
129+
"PV inverter %s: state changed to WORKING.",
130130
self._component_id,
131131
)
132132
return ComponentStatusEnum.WORKING

0 commit comments

Comments
 (0)