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();
|
return _radio->isChipConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HoymilesRadio::isPVariant()
|
||||||
|
{
|
||||||
|
return _radio->isPVariant();
|
||||||
|
}
|
||||||
|
|
||||||
void HoymilesRadio::openReadingPipe()
|
void HoymilesRadio::openReadingPipe()
|
||||||
{
|
{
|
||||||
serial_u s;
|
serial_u s;
|
||||||
|
|||||||
@ -47,6 +47,7 @@ public:
|
|||||||
|
|
||||||
bool isIdle();
|
bool isIdle();
|
||||||
bool isConnected();
|
bool isConnected();
|
||||||
|
bool isPVariant();
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T* enqueCommand()
|
T* enqueCommand()
|
||||||
|
|||||||
@ -66,6 +66,7 @@ void WebApiSysstatusClass::onSystemStatus(AsyncWebServerRequest* request)
|
|||||||
root[F("uptime")] = esp_timer_get_time() / 1000000;
|
root[F("uptime")] = esp_timer_get_time() / 1000000;
|
||||||
|
|
||||||
root[F("radio_connected")] = Hoymiles.getRadio()->isConnected();
|
root[F("radio_connected")] = Hoymiles.getRadio()->isConnected();
|
||||||
|
root[F("radio_pvariant")] = Hoymiles.getRadio()->isPVariant();
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export default defineComponent({
|
|||||||
sketch_used: 0,
|
sketch_used: 0,
|
||||||
// RadioInfo
|
// RadioInfo
|
||||||
radio_connected: false,
|
radio_connected: false,
|
||||||
|
radio_pvariant: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -17,6 +17,18 @@
|
|||||||
<span v-else>not connected</span>
|
<span v-else>not connected</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -30,6 +42,7 @@ import { defineComponent } from 'vue';
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
radio_connected: { type: Boolean, required: true },
|
radio_connected: { type: Boolean, required: true },
|
||||||
|
radio_pvariant: { type: Boolean, required: true },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user