Repository navigation
remove obsolet ramdisk and module legacy code - #3639
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes legacy ramdisk-backed storage and legacy CLI entrypoints across multiple device/vehicle modules, consolidating RAMDISK_PATH into helpermodules.constants and updating tests accordingly.
Changes:
- Removed the ramdisk IO/files implementation and the associated
MockRamdisktest utility. - Removed many legacy
read_legacy/CLI entrypoints from device/vehicle modules and trimmed unused imports. - Centralized
RAMDISK_PATHinhelpermodules.constantsand updated call sites (plus updated value stores to always use the broker-backed stores).
Reviewed changes
Copilot reviewed 46 out of 47 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/test_utils/mock_ramdisk.py | Removed ramdisk-mocking utility used by older tests. |
| packages/modules/vehicles/vwid/libeuda.py | Switched RAMDISK_PATH import to helpermodules.constants. |
| packages/modules/vehicles/vwgroup/vwgroup.py | Switched RAMDISK_PATH import to helpermodules.constants. |
| packages/modules/vehicles/tesla/soc.py | Removed legacy CLI code and narrowed imports to supported configuration. |
| packages/modules/vehicles/polestar/auth.py | Switched RAMDISK_PATH import to helpermodules.constants; minor formatting cleanup. |
| packages/modules/vehicles/kia/api.py | Switched RAMDISK_PATH import to helpermodules.constants; formatting cleanups. |
| packages/modules/devices/youless/youless/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/varta/varta/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/solarmax/solarmax/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/solar_world/solar_world/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/solar_watt/solar_watt/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/solar_view/solar_view/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/solar_log/solar_log/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/smartfox/smartfox/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/smart_me/smart_me/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/sma/sma_shm/device.py | Removed legacy CLI helpers and narrowed imports. |
| packages/modules/devices/sma/sma_shm/counter_test.py | Updated test to validate broker-backed store state instead of ramdisk files. |
| packages/modules/devices/rct/rct/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/powerfox/powerfox/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/lg/lg/lg_test.py | Removed MockRamdisk fixture usage from tests. |
| packages/modules/devices/kostal/kostal_piko_old/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/generic/json/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/generic/http/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/fronius/fronius/inverter_production_meter_test.py | Removed ramdisk mocking fixture usage. |
| packages/modules/devices/fronius/fronius/counter_sm_test.py | Removed ramdisk mocking fixture usage and updated signatures. |
| packages/modules/devices/fronius/fronius/counter_s0_test.py | Removed ramdisk mocking fixture usage and updated signatures. |
| packages/modules/devices/fronius/fronius/bat_test.py | Removed ramdisk mocking fixture usage and updated signatures. |
| packages/modules/devices/fems/fems/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/fems/fems/device test.py | Removed legacy tests tied to removed legacy entrypoint. |
| packages/modules/devices/e3dc/e3dc/device.py | Removed legacy CLI path and legacy ramdisk/simcount integration code. |
| packages/modules/devices/discovergy/discovergy/device.py | Removed legacy CLI entrypoint and related imports. |
| packages/modules/devices/discovergy/discovergy/device test.py | Deleted legacy tests for the removed read_legacy entrypoint. |
| packages/modules/devices/deye/deye/device.py | Removed legacy CLI path and related imports. |
| packages/modules/devices/batterx/batterx/device.py | Removed legacy CLI path and related imports. |
| packages/modules/common/store/ramdisk/io.py | Deleted ramdisk IO implementation. |
| packages/modules/common/store/ramdisk/files.py | Deleted ramdisk file mapping implementation. |
| packages/modules/common/store/ramdisk/files_test.py | Deleted tests for the removed ramdisk file mapping. |
| packages/modules/common/store/_inverter.py | Removed ramdisk-backed value store variant; always use broker-backed store. |
| packages/modules/common/store/_counter.py | Removed ramdisk-backed value store variant; always use broker-backed store. |
| packages/modules/common/store/_chargepoint.py | Removed ramdisk-backed value store variant; always use broker-backed store. |
| packages/modules/common/store/_car.py | Removed ramdisk-backed value store variant; always use broker-backed store. |
| packages/modules/common/store/_battery.py | Removed ramdisk-backed value store variant; always use broker-backed store. |
| packages/modules/common/store/init.py | Stopped exporting ramdisk helpers/RAMDISK_PATH from store package. |
| packages/modules/common/powerwall.py | Switched RAMDISK_PATH import to helpermodules.constants. |
| packages/helpermodules/logger.py | Switched to helpermodules.constants.RAMDISK_PATH (as Path) and updated log file path handling. |
| packages/helpermodules/constants.py | Introduced RAMDISK_PATH as a shared Path constant. |
Comments suppressed due to low confidence (1)
packages/modules/devices/fems/fems/device test.py:41
- After removing the legacy
read_legacytests, this module no longer defines anytest_*functions/methods (it only has an autouse fixture + assertion helpers), so pytest will collect 0 tests from this file. Consider deleting this file, or adding replacement tests that cover the supported (non-legacy) Discovergy device update path.
def assert_get_last_reading_called(self, *meter_ids):
assert self.mock_get_last_reading.call_count == len(meter_ids)
# Check that one call was made for each meter_id, ignoring order:
assert sorted(call_args[0][1] for call_args in self.mock_get_last_reading.call_args_list) == sorted(meter_ids)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #!/usr/bin/env python3 | ||
| import logging | ||
| from typing import Iterable, Optional, Union, List | ||
| from typing import Iterable, Union |
| from modules.devices.rct.rct import rct_lib | ||
| from modules.devices.rct.rct.bat import RctBat | ||
| from modules.devices.rct.rct.config import Rct, RctConfiguration, RctBatSetup, RctCounterSetup, RctInverterSetup | ||
| from modules.devices.rct.rct.config import Rct, RctBatSetup, RctCounterSetup, RctInverterSetup |
LKuemmel
force-pushed
the
remove_obsolet_code
branch
from
July 8, 2026 07:07
b3974af to
b1b2aec
Compare
Comment on lines
73
to
+74
| def get_inverter_value_store(component_num: int) -> PurgeInverterState: | ||
| return PurgeInverterState(LoggingValueStore( | ||
| (InverterValueStoreRamdisk if compatibility.is_ramdisk_in_use() else InverterValueStoreBroker)(component_num) | ||
| )) | ||
| return PurgeInverterState(LoggingValueStore(InverterValueStoreBroker(component_num))) |
| logging.getLogger("websockets").setLevel(logging.WARNING) | ||
|
|
||
| thread_errors_path = Path(RAMDISK_PATH+"thread_errors.log") | ||
| thread_errors_path = Path(RAMDISK_PATH / "thread_errors.log") |
Comment on lines
40
to
43
| def update(self, session: Session) -> None: | ||
| power = self.__get_power(session) | ||
| if compatibility.is_ramdisk_in_use(): | ||
| # for compatibility: in 1.x power URL values are positive! | ||
| power *= -1 | ||
| exported = self.__get_exported(session) | ||
| _, exported = self.peak_filter.check_values(power, None, exported) |
Comment on lines
5
to
9
| from modules.common.component_state import CounterState | ||
| from modules.common.component_state import InverterState | ||
| from modules.devices.discovergy.discovergy import api, counter, inverter | ||
| from modules.devices.discovergy.discovergy.device import read_legacy | ||
|
|
||
| SAMPLE_COUNTER_STATE = CounterState( |
Comment on lines
8
to
12
| from modules.common.configurable_device import ConfigurableDevice, ComponentFactoryByType, MultiComponentUpdater | ||
| from modules.devices.kostal.kostal_piko_old import inverter | ||
| from modules.devices.kostal.kostal_piko_old.config import (KostalPikoOld, | ||
| KostalPikoOldConfiguration, | ||
| KostalPikoOldInverterSetup) | ||
| from modules.devices.kostal.kostal_piko_old.inverter import KostalPikoOldInverter |
Comment on lines
+33
to
+41
| assert vars(sma_counter.store.delegate.delegate.state) == vars(CounterState(currents=[-17.16, -17.1, -16.02], | ||
| powers=[-4077.0, -4077.0, -3813.0], | ||
| voltages=[238.438, 239.298, 238.738], | ||
| power_factors=[0.999, 0.999, 1.0], | ||
| imported=7500240.0, | ||
| exported=86688627.0, | ||
| power=-11967.0, | ||
| frequency=50, | ||
| serial_number=None)) |
ndrsnhs
pushed a commit
to ndrsnhs/core
that referenced
this pull request
Aug 24, 2026
* remove obsolet ramdisk code * remove module legacy code * ammend * linting * review * falke8 * review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.