From 8690f5b8423c8e401f832961fb689ef7b137e1fc Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Thu, 23 May 2024 18:58:57 +0200 Subject: [PATCH] Generate MeterClassID and EthernetState enum --- software/pio_hooks.py | 11 ++---- .../modules/energy_manager/energy_manager.cpp | 2 +- .../ethernet/Ethernet State.uint8.enum | 4 ++ software/src/modules/ethernet/ethernet.cpp | 22 +++++------ software/src/modules/ethernet/ethernet.h | 10 +---- software/src/modules/meters/.gitignore | 1 - .../modules/meters/Meter Class ID.uint8.enum | 13 +++++++ software/src/modules/meters/imeter.h | 2 +- .../src/modules/meters/meter_class_none.cpp | 2 +- software/src/modules/meters/meters.cpp | 2 +- software/src/modules/meters/prepare.py | 37 ------------------- .../src/modules/meters_modbus_tcp/prepare.py | 6 +-- software/src/modules/mqtt/mqtt.cpp | 2 +- software/src/modules/wifi/wifi.cpp | 4 +- .../src/modules/meters/api.ts.template_header | 2 +- software/web/src/modules/meters/main.tsx | 4 +- .../meters_api/plugin_meters_config.tsx | 2 +- .../meters_em/plugin_meters_config.tsx | 2 +- .../meters_evse_v2/plugin_meters_config.tsx | 2 +- .../meters_meta/plugin_meters_config.tsx | 2 +- .../plugin_meters_config.tsx | 2 +- .../plugin_meters_config.tsx | 2 +- .../meters_pv_faker/plugin_meters_config.tsx | 2 +- .../plugin_meters_config.tsx | 2 +- .../plugin_meters_config.tsx | 2 +- .../meters_sun_spec/plugin_meters_config.tsx | 2 +- .../web/src/modules/power_manager/main.tsx | 2 +- 27 files changed, 57 insertions(+), 89 deletions(-) create mode 100644 software/src/modules/ethernet/Ethernet State.uint8.enum create mode 100644 software/src/modules/meters/Meter Class ID.uint8.enum diff --git a/software/pio_hooks.py b/software/pio_hooks.py index 873aa49d9..69d638c54 100644 --- a/software/pio_hooks.py +++ b/software/pio_hooks.py @@ -1111,12 +1111,10 @@ def format_translation(translation, type_only, indent): if len(line_parts) > 1: value_number = int(line_parts[1].strip()) - value_count = None else: value_number += 1 - if value_count != None: - value_count += 1 + value_count += 1 enum_values.append(' {0} = {1},\n'.format(value_name.camel, value_number)) enum_cases.append(' case {0}::{1}: return "{2}";\n'.format(enum_name.camel, value_name.camel, value_name.space)) @@ -1128,14 +1126,11 @@ def format_translation(translation, type_only, indent): f.write(f'enum class {enum_name.camel} : {name_parts[1]}_t {{\n') f.write(''.join(enum_values)) f.write('};\n\n') - - if value_count != None: - f.write(f'#define {enum_name.upper}_COUNT {value_count}\n\n') - + f.write(f'#define {enum_name.upper}_COUNT {value_count}\n\n') f.write(f'const char *get_{enum_name.under}_name({enum_name.camel} value);\n') with open(os.path.join(mod_path, enum_name.under + '.enum.cpp'), 'w', encoding='utf-8') as f: - f.write(f'// WARNING: This file is generated from {name}.\n\n') + f.write(f'// WARNING: This file is generated from "{name}"\n\n') f.write(f'#include "{enum_name.under}.enum.h"\n\n') f.write(f'const char *get_{enum_name.under}_name({enum_name.camel} value)\n') f.write('{\n') diff --git a/software/src/modules/energy_manager/energy_manager.cpp b/software/src/modules/energy_manager/energy_manager.cpp index e60956e4e..31e6ff84c 100644 --- a/software/src/modules/energy_manager/energy_manager.cpp +++ b/software/src/modules/energy_manager/energy_manager.cpp @@ -475,7 +475,7 @@ void EnergyManager::start_network_check_task() bool disconnected; do { #if MODULE_ETHERNET_AVAILABLE() - if (ethernet.get_connection_state() == EthernetState::CONNECTED) { + if (ethernet.get_connection_state() == EthernetState::Connected) { disconnected = false; break; } diff --git a/software/src/modules/ethernet/Ethernet State.uint8.enum b/software/src/modules/ethernet/Ethernet State.uint8.enum new file mode 100644 index 000000000..53950903d --- /dev/null +++ b/software/src/modules/ethernet/Ethernet State.uint8.enum @@ -0,0 +1,4 @@ +Not Configured +Not Connected +Connecting +Connected diff --git a/software/src/modules/ethernet/ethernet.cpp b/software/src/modules/ethernet/ethernet.cpp index b305019bb..51797a25a 100644 --- a/software/src/modules/ethernet/ethernet.cpp +++ b/software/src/modules/ethernet/ethernet.cpp @@ -76,7 +76,7 @@ void Ethernet::pre_setup() }}; state = Config::Object({ - {"connection_state", Config::Uint((uint)EthernetState::NOT_CONFIGURED)}, + {"connection_state", Config::Uint((uint)EthernetState::NotConfigured)}, {"connection_start", Config::Uint(0)}, {"connection_end", Config::Uint(0)}, {"ip", Config::Str("0.0.0.0", 7, 15)}, @@ -107,7 +107,7 @@ void Ethernet::setup() config_in_use = config.get_owned_copy(); - connection_state = EthernetState::NOT_CONFIGURED; + connection_state = EthernetState::NotConfigured; state.get("connection_state")->updateUint((uint)connection_state); initialized = true; @@ -121,14 +121,14 @@ void Ethernet::setup() hostname = String(BUILD_HOST_PREFIX) + "-" + local_uid_str; #endif - connection_state = EthernetState::NOT_CONNECTED; - state.get("connection_state")->updateUint((uint)EthernetState::NOT_CONNECTED); + connection_state = EthernetState::NotConnected; + state.get("connection_state")->updateUint((uint)connection_state); WiFi.onEvent([this](arduino_event_id_t event, arduino_event_info_t info) { logger.printfln("Started"); ETH.setHostname(hostname.c_str()); - connection_state = EthernetState::NOT_CONNECTED; + connection_state = EthernetState::NotConnected; task_scheduler.scheduleOnce([this](){ state.get("connection_state")->updateUint((uint)connection_state); @@ -157,7 +157,7 @@ void Ethernet::setup() ETH.config((uint32_t)0, (uint32_t)0, (uint32_t)0); } - connection_state = EthernetState::CONNECTING; + connection_state = EthernetState::Connecting; task_scheduler.scheduleOnce([this, link_speed, full_duplex](){ state.get("connection_state")->updateUint((uint)connection_state); @@ -183,7 +183,7 @@ void Ethernet::setup() was_connected = true; last_connected = now; - connection_state = EthernetState::CONNECTED; + connection_state = EthernetState::Connected; task_scheduler.scheduleOnce([this, now, ip, subnet](){ state.get("connection_state")->updateUint((uint)connection_state); @@ -205,7 +205,7 @@ void Ethernet::setup() uint32_t now = millis(); - connection_state = EthernetState::CONNECTING; + connection_state = EthernetState::Connecting; task_scheduler.scheduleOnce([this, now](){ state.get("connection_state")->updateUint((uint)connection_state); @@ -222,7 +222,7 @@ void Ethernet::setup() uint32_t now = millis(); - connection_state = EthernetState::NOT_CONNECTED; + connection_state = EthernetState::NotConnected; task_scheduler.scheduleOnce([this, now](){ state.get("connection_state")->updateUint((uint)connection_state); @@ -239,7 +239,7 @@ void Ethernet::setup() uint32_t now = millis(); - connection_state = EthernetState::NOT_CONNECTED; + connection_state = EthernetState::NotConnected; task_scheduler.scheduleOnce([this, now](){ state.get("connection_state")->updateUint((uint)connection_state); @@ -268,7 +268,7 @@ void Ethernet::register_urls() EthernetState Ethernet::get_connection_state() const { if (!initialized) - return EthernetState::NOT_CONFIGURED; + return EthernetState::NotConfigured; return this->connection_state; } diff --git a/software/src/modules/ethernet/ethernet.h b/software/src/modules/ethernet/ethernet.h index 878ab044c..4bf02734e 100644 --- a/software/src/modules/ethernet/ethernet.h +++ b/software/src/modules/ethernet/ethernet.h @@ -22,13 +22,7 @@ #include "config.h" #include "module.h" - -enum class EthernetState { - NOT_CONFIGURED = 0, - NOT_CONNECTED = 1, - CONNECTING = 2, - CONNECTED = 3 -}; +#include "ethernet_state.enum.h" class Ethernet final : public IModule { @@ -52,5 +46,5 @@ class Ethernet final : public IModule OwnedConfig config_in_use; String hostname; - EthernetState connection_state = EthernetState::NOT_CONFIGURED; + EthernetState connection_state = EthernetState::NotConfigured; }; diff --git a/software/src/modules/meters/.gitignore b/software/src/modules/meters/.gitignore index 11a1dd376..e9145f308 100644 --- a/software/src/modules/meters/.gitignore +++ b/software/src/modules/meters/.gitignore @@ -1,3 +1,2 @@ meter_value_id.h meter_value_id.cpp -meters_defs.h diff --git a/software/src/modules/meters/Meter Class ID.uint8.enum b/software/src/modules/meters/Meter Class ID.uint8.enum new file mode 100644 index 000000000..ef885f100 --- /dev/null +++ b/software/src/modules/meters/Meter Class ID.uint8.enum @@ -0,0 +1,13 @@ +None +RS485 Bricklet +EVSE V2 +Energy Manager +API +Sun Spec +Modbus TCP +SMA Speedwire + +# Unofficial meter classes +Mqtt Mirror = 200 +Pv Faker = 201 +Meta = 202 diff --git a/software/src/modules/meters/imeter.h b/software/src/modules/meters/imeter.h index 8de14a505..2a760383a 100644 --- a/software/src/modules/meters/imeter.h +++ b/software/src/modules/meters/imeter.h @@ -21,7 +21,7 @@ #include #include "WString.h" -#include "meters_defs.h" +#include "meter_class_id.enum.h" #include "config.h" class IMeter diff --git a/software/src/modules/meters/meter_class_none.cpp b/software/src/modules/meters/meter_class_none.cpp index f0c5a300a..b32b81aef 100644 --- a/software/src/modules/meters/meter_class_none.cpp +++ b/software/src/modules/meters/meter_class_none.cpp @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#include "meters_defs.h" +#include "meter_class_id.enum.h" #include "meter_class_none.h" #include "gcc_warnings.h" diff --git a/software/src/modules/meters/meters.cpp b/software/src/modules/meters/meters.cpp index bd5f142a2..31989783c 100644 --- a/software/src/modules/meters/meters.cpp +++ b/software/src/modules/meters/meters.cpp @@ -64,7 +64,7 @@ void Meters::pre_setup() init_uint32_array(meter_slot.index_cache_currents, INDEX_CACHE_CURRENT_COUNT, UINT32_MAX); } - generators.reserve(METER_CLASSES); + generators.reserve(METER_CLASS_ID_COUNT); register_meter_generator(MeterClassID::None, &meter_generator_none); last_reset_prototype = Config::Object({ diff --git a/software/src/modules/meters/prepare.py b/software/src/modules/meters/prepare.py index 2155e3a11..67395b506 100644 --- a/software/src/modules/meters/prepare.py +++ b/software/src/modules/meters/prepare.py @@ -272,40 +272,3 @@ def format_value_id_tree(sub_tree, indent): '{{{groups}}}': ',\n '.join(translation_groups[lang]), '{{{fragments}}}': ',\n '.join(translation_fragments[lang]), }) - -# NEVER EVER EDIT OR REMOVE IDS. Only append new ones. Changing or removing IDs is a breaking API and config change! -classes = [ - 'None', - 'RS485 Bricklet', - 'EVSE V2', - 'Energy Manager', - 'API', - 'Sun Spec', - 'Modbus TCP', - 'SMA Speedwire', -] - -class_values = [] - -for i, name in enumerate(classes): - class_values.append(' {0} = {1},\n'.format(util.FlavoredName(name).get().camel, i)) - -# Unofficial meter classes -class_values.append(' {0} = {1},\n'.format(util.FlavoredName('Mqtt Mirror').get().camel, 200)) -class_values.append(' {0} = {1},\n'.format(util.FlavoredName('Pv Faker' ).get().camel, 201)) -class_values.append(' {0} = {1},\n'.format(util.FlavoredName('Meta' ).get().camel, 202)) - -with open('meters_defs.h', 'w', encoding='utf-8') as f: - f.write('// WARNING: This file is generated.\n\n') - f.write('#include \n\n') - f.write('#pragma once\n\n') - f.write('enum class MeterClassID : uint8_t {\n') - f.write(''.join(class_values)) - f.write('};\n\n') - f.write(f'#define METER_CLASSES {len(class_values)}') - -with open('../../../web/src/modules/meters/meters_defs.ts', 'w', encoding='utf-8') as f: - f.write('// WARNING: This file is generated.\n\n') - f.write('export const enum MeterClassID {\n') - f.write(''.join(class_values)) - f.write('}\n') diff --git a/software/src/modules/meters_modbus_tcp/prepare.py b/software/src/modules/meters_modbus_tcp/prepare.py index ba1d0a68a..418a77c8c 100644 --- a/software/src/modules/meters_modbus_tcp/prepare.py +++ b/software/src/modules/meters_modbus_tcp/prepare.py @@ -26,7 +26,7 @@ def make_modbus_value_type(register_count, is_signed, is_float, register_order_i return register_count | ((1 if is_signed else 0) << 3) | ((1 if is_float else 0) << 4) | ((1 if register_order_is_le else 0) << 5) -modbus_value_type = [ +modbus_value_types = [ ('None', 0), ('U16', make_modbus_value_type(1, False, False, False)), ('S16', make_modbus_value_type(1, True, False, False)), @@ -47,8 +47,8 @@ def make_modbus_value_type(register_count, is_signed, is_float, register_order_i with open('Modbus Value Type.uint8.enum', 'w', encoding='utf-8') as f: f.write('# WARNING: This file is generated\n') - for name_and_value in modbus_value_type: - f.write(f'{name_and_value[0]} = {name_and_value[1]}\n') + for item in modbus_value_types: + f.write(f'{item[0]} = {item[1]}\n') VALUE_ID_META = 0xFFFFFFFF - 1 diff --git a/software/src/modules/mqtt/mqtt.cpp b/software/src/modules/mqtt/mqtt.cpp index 48f281203..3a690bf9a 100644 --- a/software/src/modules/mqtt/mqtt.cpp +++ b/software/src/modules/mqtt/mqtt.cpp @@ -732,7 +732,7 @@ void Mqtt::register_events() // Wait 20 secs to not spam the event log with a failed connection attempt. bool start_immediately = false; #if MODULE_ETHERNET_AVAILABLE() - start_immediately = ethernet.get_connection_state() == EthernetState::CONNECTED; + start_immediately = ethernet.get_connection_state() == EthernetState::Connected; #endif if (start_immediately) { esp_mqtt_client_start(client); diff --git a/software/src/modules/wifi/wifi.cpp b/software/src/modules/wifi/wifi.cpp index a136c0481..edb0b0289 100644 --- a/software/src/modules/wifi/wifi.cpp +++ b/software/src/modules/wifi/wifi.cpp @@ -657,7 +657,7 @@ void Wifi::setup() bool connected = (WifiState)state.get("connection_state")->asInt() == WifiState::CONNECTED; #if MODULE_ETHERNET_AVAILABLE() - connected = connected || ethernet.get_connection_state() == EthernetState::CONNECTED; + connected = connected || ethernet.get_connection_state() == EthernetState::Connected; #endif static int stop_soft_ap_runs = 0; @@ -682,7 +682,7 @@ void Wifi::setup() }, enable_sta #if MODULE_ETHERNET_AVAILABLE() - || (ethernet.is_enabled() && ethernet.get_connection_state() != EthernetState::NOT_CONNECTED) + || (ethernet.is_enabled() && ethernet.get_connection_state() != EthernetState::NotConnected) #endif ? 30 * 1000 : 1000, 10 * 1000); } diff --git a/software/web/src/modules/meters/api.ts.template_header b/software/web/src/modules/meters/api.ts.template_header index 386dea272..5f33ebd5c 100644 --- a/software/web/src/modules/meters/api.ts.template_header +++ b/software/web/src/modules/meters/api.ts.template_header @@ -1,4 +1,4 @@ -import { MeterClassID } from "./meters_defs"; +import { MeterClassID } from "./meter_class_id.enum"; {{{imports}}} type MeterConfig = diff --git a/software/web/src/modules/meters/main.tsx b/software/web/src/modules/meters/main.tsx index 0880c1bc4..d72735ac8 100644 --- a/software/web/src/modules/meters/main.tsx +++ b/software/web/src/modules/meters/main.tsx @@ -21,7 +21,7 @@ import { METERS_SLOTS } from "../../build"; import * as util from "../../ts/util"; import * as API from "../../ts/api"; import { __, translate_unchecked } from "../../ts/translation"; -import { h, createRef, Fragment, Component, RefObject, ComponentChild, toChildArray } from "preact"; +import { h, createRef, Fragment, Component, RefObject, ComponentChild } from "preact"; import { Button, ButtonGroup } from "react-bootstrap"; import { FormRow } from "../../ts/components/form_row"; import { InputSelect } from "../../ts/components/input_select"; @@ -33,7 +33,7 @@ import { SubPage } from "../../ts/components/sub_page"; import { UplotLoader } from "../../ts/components/uplot_loader"; import { UplotWrapper, UplotData } from "../../ts/components/uplot_wrapper"; import { MeterValueID, METER_VALUE_IDS, METER_VALUE_INFOS, METER_VALUE_ORDER } from "./meter_value_id"; -import { MeterClassID } from "./meters_defs"; +import { MeterClassID } from "./meter_class_id.enum"; import { MeterConfig, MeterConfigPlugin } from "./types"; import { Table } from "../../ts/components/table"; import { PageHeader } from "../../ts/components/page_header"; diff --git a/software/web/src/modules/meters_api/plugin_meters_config.tsx b/software/web/src/modules/meters_api/plugin_meters_config.tsx index 4331daa5c..aeed23e12 100644 --- a/software/web/src/modules/meters_api/plugin_meters_config.tsx +++ b/software/web/src/modules/meters_api/plugin_meters_config.tsx @@ -20,7 +20,7 @@ import { h, Fragment, Component, ComponentChildren } from 'preact' import { __, translate_unchecked } from "../../ts/translation"; import * as util from "../../ts/util"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { MeterValueID, MeterValueTreeType, METER_VALUE_INFOS, METER_VALUE_TREE } from "../meters/meter_value_id"; import { MeterConfig } from "../meters/types"; import { Table, TableRow } from "../../ts/components/table"; diff --git a/software/web/src/modules/meters_em/plugin_meters_config.tsx b/software/web/src/modules/meters_em/plugin_meters_config.tsx index 3cdda7d1c..12d9e9d23 100644 --- a/software/web/src/modules/meters_em/plugin_meters_config.tsx +++ b/software/web/src/modules/meters_em/plugin_meters_config.tsx @@ -20,7 +20,7 @@ import { h, ComponentChildren } from "preact"; import { __, translate_unchecked } from "../../ts/translation"; import * as util from "../../ts/util"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { MeterConfig } from "../meters/types"; import { InputText } from "../../ts/components/input_text"; import { FormRow } from "../../ts/components/form_row"; diff --git a/software/web/src/modules/meters_evse_v2/plugin_meters_config.tsx b/software/web/src/modules/meters_evse_v2/plugin_meters_config.tsx index 7f1c324af..b3b781d08 100644 --- a/software/web/src/modules/meters_evse_v2/plugin_meters_config.tsx +++ b/software/web/src/modules/meters_evse_v2/plugin_meters_config.tsx @@ -20,7 +20,7 @@ import { h, ComponentChildren } from "preact"; import { __, translate_unchecked } from "../../ts/translation"; import * as util from "../../ts/util"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { MeterConfig } from "../meters/types"; import { InputText } from "../../ts/components/input_text"; import { FormRow } from "../../ts/components/form_row"; diff --git a/software/web/src/modules/meters_meta/plugin_meters_config.tsx b/software/web/src/modules/meters_meta/plugin_meters_config.tsx index 7e22f8acf..b3e6a46ab 100644 --- a/software/web/src/modules/meters_meta/plugin_meters_config.tsx +++ b/software/web/src/modules/meters_meta/plugin_meters_config.tsx @@ -22,7 +22,7 @@ import * as util from "../../ts/util"; import { __ } from "../../ts/translation"; import { METERS_SLOTS } from "../../build"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { MeterConfig } from "../meters/types"; import { h, ComponentChildren } from "preact"; diff --git a/software/web/src/modules/meters_modbus_tcp/plugin_meters_config.tsx b/software/web/src/modules/meters_modbus_tcp/plugin_meters_config.tsx index a068f72f0..9dc5225c1 100644 --- a/software/web/src/modules/meters_modbus_tcp/plugin_meters_config.tsx +++ b/software/web/src/modules/meters_modbus_tcp/plugin_meters_config.tsx @@ -20,7 +20,7 @@ import * as util from "../../ts/util"; import { h, Fragment, Component, ComponentChildren } from "preact"; import { __ } from "../../ts/translation"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { MeterConfig } from "../meters/types"; import { MeterValueIDSelector, get_meter_value_id_name } from "../meters_api/plugin_meters_config"; import { MeterModbusTCPTableID } from "./meter_modbus_tcp_table_id.enum"; diff --git a/software/web/src/modules/meters_mqtt_mirror/plugin_meters_config.tsx b/software/web/src/modules/meters_mqtt_mirror/plugin_meters_config.tsx index 3f5a4d3c4..7af6a4434 100644 --- a/software/web/src/modules/meters_mqtt_mirror/plugin_meters_config.tsx +++ b/software/web/src/modules/meters_mqtt_mirror/plugin_meters_config.tsx @@ -20,7 +20,7 @@ import { h, ComponentChildren } from "preact"; import { __, translate_unchecked } from "../../ts/translation"; import * as util from "../../ts/util"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { MeterConfig } from "../meters/types"; import { InputText } from "../../ts/components/input_text"; import { FormRow } from "../../ts/components/form_row"; diff --git a/software/web/src/modules/meters_pv_faker/plugin_meters_config.tsx b/software/web/src/modules/meters_pv_faker/plugin_meters_config.tsx index 8a51b6315..f5720d74e 100644 --- a/software/web/src/modules/meters_pv_faker/plugin_meters_config.tsx +++ b/software/web/src/modules/meters_pv_faker/plugin_meters_config.tsx @@ -20,7 +20,7 @@ import { h, ComponentChildren } from "preact"; import { __ } from "../../ts/translation"; import * as util from "../../ts/util"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { MeterConfig } from "../meters/types"; import { FormRow } from "../../ts/components/form_row"; import { InputText } from "../../ts/components/input_text"; diff --git a/software/web/src/modules/meters_rs485_bricklet/plugin_meters_config.tsx b/software/web/src/modules/meters_rs485_bricklet/plugin_meters_config.tsx index 3ac11b251..fd85997ac 100644 --- a/software/web/src/modules/meters_rs485_bricklet/plugin_meters_config.tsx +++ b/software/web/src/modules/meters_rs485_bricklet/plugin_meters_config.tsx @@ -20,7 +20,7 @@ import { h, ComponentChildren } from "preact"; import { __, translate_unchecked } from "../../ts/translation"; import * as util from "../../ts/util"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { MeterConfig } from "../meters/types"; import { InputText } from "../../ts/components/input_text"; import { FormRow } from "../../ts/components/form_row"; diff --git a/software/web/src/modules/meters_sma_speedwire/plugin_meters_config.tsx b/software/web/src/modules/meters_sma_speedwire/plugin_meters_config.tsx index e9ea361f7..a888f16ac 100644 --- a/software/web/src/modules/meters_sma_speedwire/plugin_meters_config.tsx +++ b/software/web/src/modules/meters_sma_speedwire/plugin_meters_config.tsx @@ -20,7 +20,7 @@ import { h, ComponentChildren } from "preact"; import { __, translate_unchecked } from "../../ts/translation"; import * as util from "../../ts/util"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { MeterConfig } from "../meters/types"; import { InputText } from "../../ts/components/input_text"; import { FormRow } from "../../ts/components/form_row"; diff --git a/software/web/src/modules/meters_sun_spec/plugin_meters_config.tsx b/software/web/src/modules/meters_sun_spec/plugin_meters_config.tsx index d1ac62482..811a516de 100644 --- a/software/web/src/modules/meters_sun_spec/plugin_meters_config.tsx +++ b/software/web/src/modules/meters_sun_spec/plugin_meters_config.tsx @@ -21,7 +21,7 @@ import * as API from "../../ts/api"; import * as util from "../../ts/util"; import { h, Fragment, Component, ComponentChildren } from "preact"; import { __, translate_unchecked } from "../../ts/translation"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { MeterConfig } from "../meters/types"; import { InputText } from "../../ts/components/input_text"; import { InputNumber } from "../../ts/components/input_number"; diff --git a/software/web/src/modules/power_manager/main.tsx b/software/web/src/modules/power_manager/main.tsx index c67328c59..49f8943a2 100644 --- a/software/web/src/modules/power_manager/main.tsx +++ b/software/web/src/modules/power_manager/main.tsx @@ -34,7 +34,7 @@ import { InputSelect } from "../../ts/components/input_select"; import { Switch } from "../../ts/components/switch"; import { SubPage } from "../../ts/components/sub_page"; import { MeterConfig } from "../meters/types"; -import { MeterClassID } from "../meters/meters_defs"; +import { MeterClassID } from "../meters/meter_class_id.enum"; import { NavbarItem } from "../../ts/components/navbar_item"; import { StatusSection } from "../../ts/components/status_section"; import { CheckCircle, Circle, Settings, Sun } from "react-feather";