diff --git a/lib/Hoymiles/src/HoymilesRadio_CMT.cpp b/lib/Hoymiles/src/HoymilesRadio_CMT.cpp index 5a0b4492a..d42b4d2e8 100644 --- a/lib/Hoymiles/src/HoymilesRadio_CMT.cpp +++ b/lib/Hoymiles/src/HoymilesRadio_CMT.cpp @@ -201,6 +201,11 @@ uint32_t HoymilesRadio_CMT::getMaxFrequency() return MAX_FREQ; } +uint32_t HoymilesRadio_CMT::getChannelWidth() +{ + return FH_OFFSET * CMT2300A_ONE_STEP_SIZE; +} + void ARDUINO_ISR_ATTR HoymilesRadio_CMT::handleInt1() { _packetSent = true; diff --git a/lib/Hoymiles/src/HoymilesRadio_CMT.h b/lib/Hoymiles/src/HoymilesRadio_CMT.h index 11d34fdfc..d9858c832 100644 --- a/lib/Hoymiles/src/HoymilesRadio_CMT.h +++ b/lib/Hoymiles/src/HoymilesRadio_CMT.h @@ -28,6 +28,7 @@ class HoymilesRadio_CMT : public HoymilesRadio { static uint32_t getMinFrequency(); static uint32_t getMaxFrequency(); + static uint32_t getChannelWidth(); static uint32_t getFrequencyFromChannel(const uint8_t channel); static uint8_t getChannelFromFrequency(const uint32_t frequency); diff --git a/src/WebApi_dtu.cpp b/src/WebApi_dtu.cpp index c8a87678f..ccf0aa08f 100644 --- a/src/WebApi_dtu.cpp +++ b/src/WebApi_dtu.cpp @@ -45,6 +45,9 @@ void WebApiDtuClass::onDtuAdminGet(AsyncWebServerRequest* request) root["cmt_enabled"] = Hoymiles.getRadioCmt()->isInitialized(); root["cmt_palevel"] = config.Dtu.Cmt.PaLevel; root["cmt_frequency"] = config.Dtu.Cmt.Frequency; + root["cmt_min_freq"] = Hoymiles.getRadioCmt()->getMinFrequency(); + root["cmt_max_freq"] = Hoymiles.getRadioCmt()->getMaxFrequency(); + root["cmt_chan_width"] = Hoymiles.getRadioCmt()->getChannelWidth(); response->setLength(); request->send(response); @@ -166,4 +169,4 @@ void WebApiDtuClass::onDtuAdminPost(AsyncWebServerRequest* request) Hoymiles.getRadioCmt()->setDtuSerial(config.Dtu.Serial); Hoymiles.getRadioCmt()->setInverterTargetFrequency(config.Dtu.Cmt.Frequency); Hoymiles.setPollInterval(config.Dtu.PollInterval); -} \ No newline at end of file +} diff --git a/webapp/src/types/DtuConfig.ts b/webapp/src/types/DtuConfig.ts index 035478809..5ebc0afd4 100644 --- a/webapp/src/types/DtuConfig.ts +++ b/webapp/src/types/DtuConfig.ts @@ -6,4 +6,7 @@ export interface DtuConfig { cmt_enabled: boolean; cmt_palevel: number; cmt_frequency: number; -} \ No newline at end of file + cmt_min_freq: number; + cmt_max_freq: number; + cmt_chan_width: number; +} diff --git a/webapp/src/views/DtuAdminView.vue b/webapp/src/views/DtuAdminView.vue index ffce8e382..b98c2ccca 100644 --- a/webapp/src/views/DtuAdminView.vue +++ b/webapp/src/views/DtuAdminView.vue @@ -56,7 +56,7 @@