Skip to content

remove obsolet ramdisk and module legacy code - #3639

Merged
LKuemmel merged 7 commits into
openWB:masterfrom
LKuemmel:remove_obsolet_code
Jul 8, 2026
Merged

LKuemmel merged 7 commits into
openWB:masterfrom
LKuemmel:remove_obsolet_code

Conversation

@LKuemmel

@LKuemmel LKuemmel commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MockRamdisk test utility.
  • Removed many legacy read_legacy/CLI entrypoints from device/vehicle modules and trimmed unused imports.
  • Centralized RAMDISK_PATH in helpermodules.constants and 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_legacy tests, this module no longer defines any test_* 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
LKuemmel force-pushed the remove_obsolet_code branch from b3974af to b1b2aec Compare July 8, 2026 07:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 46 out of 47 changed files in this pull request and generated 2 comments.

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)))
Comment thread packages/helpermodules/logger.py Outdated
logging.getLogger("websockets").setLevel(logging.WARNING)

thread_errors_path = Path(RAMDISK_PATH+"thread_errors.log")
thread_errors_path = Path(RAMDISK_PATH / "thread_errors.log")

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 48 out of 49 changed files in this pull request and generated 3 comments.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 48 out of 49 changed files in this pull request and generated 1 comment.

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))
@LKuemmel
LKuemmel merged commit 4f684a7 into openWB:master Jul 8, 2026
1 check passed
@LKuemmel
LKuemmel deleted the remove_obsolet_code branch July 8, 2026 07:50
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants