Show RF chip type in SystemInfoView
This commit is contained in:
parent
0a577f8002
commit
e762abd18f
@ -169,6 +169,11 @@ bool HoymilesRadio::isConnected()
|
||||
return _radio->isChipConnected();
|
||||
}
|
||||
|
||||
bool HoymilesRadio::isPVariant()
|
||||
{
|
||||
return _radio->isPVariant();
|
||||
}
|
||||
|
||||
void HoymilesRadio::openReadingPipe()
|
||||
{
|
||||
serial_u s;
|
||||
|
||||
@ -47,6 +47,7 @@ public:
|
||||
|
||||
bool isIdle();
|
||||
bool isConnected();
|
||||
bool isPVariant();
|
||||
|
||||
template <typename T>
|
||||
T* enqueCommand()
|
||||
|
||||
@ -66,6 +66,7 @@ void WebApiSysstatusClass::onSystemStatus(AsyncWebServerRequest* request)
|
||||
root[F("uptime")] = esp_timer_get_time() / 1000000;
|
||||
|
||||
root[F("radio_connected")] = Hoymiles.getRadio()->isConnected();
|
||||
root[F("radio_pvariant")] = Hoymiles.getRadio()->isPVariant();
|
||||
|
||||
response->setLength();
|
||||
request->send(response);
|
||||
|
||||
@ -67,6 +67,7 @@ export default defineComponent({
|
||||
sketch_used: 0,
|
||||
// RadioInfo
|
||||
radio_connected: false,
|
||||
radio_pvariant: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -17,6 +17,18 @@
|
||||
<span v-else>not connected</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Chip Type</th>
|
||||
<td class="badge" :class="{
|
||||
'bg-danger': radio_connected && !radio_pvariant,
|
||||
'bg-success': radio_connected && radio_pvariant,
|
||||
'bg-secondary': !radio_connected,
|
||||
}">
|
||||
<span v-if="radio_connected && radio_pvariant">nRF24L01+</span>
|
||||
<span v-else-if="radio_connected && !radio_pvariant">nRF24L01</span>
|
||||
<span v-else>Unknown</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -30,6 +42,7 @@ import { defineComponent } from 'vue';
|
||||
export default defineComponent({
|
||||
props: {
|
||||
radio_connected: { type: Boolean, required: true },
|
||||
radio_pvariant: { type: Boolean, required: true },
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user