Skip to content

Commit

Permalink
Merge pull request tbnobody#131 from helgeerbe/hide-vedirect-livestat…
Browse files Browse the repository at this point in the history
…us-when-disabled
  • Loading branch information
helgeerbe authored Mar 9, 2023
2 parents 87794e0 + a66f818 commit 4cf4594
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/WebApi_ws_live.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ void WebApiWsLiveClass::generateJsonResponse(JsonVariant& root)
} else {
hintObj[F("default_password")] = false;
}

JsonObject vedirectObj = root.createNestedObject("vedirect");
vedirectObj[F("enabled")] = Configuration.get().Vedirect_Enabled;
}

void WebApiWsLiveClass::addField(JsonObject& root, uint8_t idx, std::shared_ptr<InverterAbstract> inv, ChannelType_t type, ChannelNum_t channel, FieldId_t fieldId, String topic)
Expand Down
7 changes: 6 additions & 1 deletion webapp/src/types/LiveDataStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ export interface Hints {
radio_problem: boolean;
}

export interface Vedirect {
enabled: boolean;
}

export interface LiveData {
inverters: Inverter[];
total: Total;
hints: Hints;
}
vedirect: Vedirect;
}
2 changes: 1 addition & 1 deletion webapp/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
</div>
</div>
</div>
<VedirectView />
<VedirectView v-show="liveData.vedirect.enabled" />
</BasePage>

<div class="modal" id="eventView" tabindex="-1">
Expand Down

0 comments on commit 4cf4594

Please sign in to comment.