Skip to content

Commit 262f97b

Browse files
committed
Fix standalone execution without Home Assistant dependency
Import INVERTER_PROFILES from emulator.models instead of directly from custom_components package. The models.py already uses importlib to load the module without triggering Home Assistant imports. This allows the emulator to run on any PC without requiring Home Assistant to be installed.
1 parent 6034069 commit 262f97b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

growatt_emulator.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# Add current directory to path
2626
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
2727

28-
from emulator.models import InverterModel, get_available_models
28+
from emulator.models import InverterModel, get_available_models, INVERTER_PROFILES
2929
from emulator.simulator import InverterSimulator
3030
from emulator.modbus_server import ModbusEmulatorServer
3131
from emulator.display import EmulatorDisplay
@@ -135,8 +135,6 @@ def select_model_interactive() -> str:
135135
print("\nAvailable Inverter Models:\n")
136136

137137
# Group by series for better display
138-
from custom_components.growatt_modbus.device_profiles import INVERTER_PROFILES
139-
140138
series_groups = {
141139
'MIC': [],
142140
'MIN': [],

0 commit comments

Comments
 (0)