[client] Consolidate mixin modules per #151 audit (batch, thermal-control, grid, contracts, plannings, typical-days) #176
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Executes the file-consolidation part of the #151 audit. All moves are between private modules — the public API (48 flat methods on
ComwattClient, see README) is unchanged, no deprecation path needed.Verified safety: no mixin carries state, no mixin defines
__init__, cooperativesuper().__init__(timeout=, auto_reauth=)works (client.py), and there are zero method-name collisions across all 16 mixins.Moves:
_batch.py→_aggregations.py:BatchMixinholds a single method,get_devices_ts_time_ago, which fans outget_device_ts_time_agoand reaches into the aggregations mixin viacast("AggregationsMixin", self)(_batch.py:41) — implicit MRO coupling that disappears once the method lives next toget_device_ts_time_ago. Drop the cast._thermal_control.py→_capacities.py: same actuation domain (capacity switch / pilot-wire vs thermal-control configs)._grid.py+_electricity_contracts.py→ one module: both are energy-market context reads (ecowatt, electricity price, contracts)._typical_days.py+_plannings.py→ one module: plannings embedtypicalDaySchedules(_plannings.py:24), same scheduling domain.Open choice: keep distinct mixin classes living in merged files, or merge the classes too (e.g. one
SchedulingMixin) — either preserves the flat API. Updateclient.pyimports accordingly.Done when: modules merged, cast removed,
pytest -qgreen, README unchanged.