show gateway/connect but greyed out in webUI

This commit is contained in:
proddy
2026-07-26 10:50:10 +02:00
parent c349c2ad0b
commit 77fac47584
3 changed files with 17 additions and 9 deletions

View File

@@ -489,7 +489,8 @@ const Customizations = () => {
</MenuItem> </MenuItem>
{devices.devices.map( {devices.devices.map(
(device: Device) => (device: Device) =>
device.id < 90 && ( device.id < 90 &&
device.e !== 0 && (
<MenuItem key={device.id} value={device.id}> <MenuItem key={device.id} value={device.id}>
{device.n}&nbsp;({device.tn}) {device.n}&nbsp;({device.tn})
</MenuItem> </MenuItem>

View File

@@ -558,16 +558,26 @@ const Devices = memo(() => {
<CircularProgress sx={{ margin: 1 }} size={18} /> <CircularProgress sx={{ margin: 1 }} size={18} />
)} )}
{tableList.map((device: Device) => ( {tableList.map((device: Device) => (
<Row key={device.id} item={device}> <Row key={device.id} item={device} disabled={device.e === 0}>
<Cell> <Cell>
<DeviceIcon type_id={device.t} /> <DeviceIcon type_id={device.t} />
&nbsp;&nbsp; &nbsp;&nbsp;
<span style={{ color: device.e === 0 ? 'grey' : 'white' }}>
{device.n} {device.n}
</span>
{device.e !== 0 && (
<span style={{ color: 'lightblue' }}> <span style={{ color: 'lightblue' }}>
&nbsp;&nbsp;({device.e}) &nbsp;&nbsp;({device.e})
</span> </span>
)}
</Cell>
<Cell stiff>
<ButtonTooltip
title={`DeviceID: 0x${('00' + device.d.toString(16).toUpperCase()).slice(-2)}, ProductID: ${device.p}`}
>
<span>{device.tn}</span>
</ButtonTooltip>
</Cell> </Cell>
<Cell stiff>{device.tn}</Cell>
</Row> </Row>
))} ))}
</Body> </Body>

View File

@@ -64,8 +64,6 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
// list is already sorted by device type // list is already sorted by device type
JsonArray devices = root["devices"].to<JsonArray>(); JsonArray devices = root["devices"].to<JsonArray>();
for (const auto & emsdevice : EMSESP::emsdevices) { for (const auto & emsdevice : EMSESP::emsdevices) {
// ignore controller and gateway
if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::CONTROLLER && emsdevice->device_type() != EMSdevice::DeviceType::GATEWAY && emsdevice->count_entities() > 0)) {
JsonObject obj = devices.add<JsonObject>(); JsonObject obj = devices.add<JsonObject>();
obj["id"] = emsdevice->unique_id(); // a unique id obj["id"] = emsdevice->unique_id(); // a unique id
obj["tn"] = emsdevice->device_type_2_device_name_translated(); // translated device type name obj["tn"] = emsdevice->device_type_2_device_name_translated(); // translated device type name
@@ -78,7 +76,6 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
obj["e"] = emsdevice->count_entities(); // number of entities obj["e"] = emsdevice->count_entities(); // number of entities
obj["url"] = emsdevice->device_type_name(); // non-translated, lower-case, used for API URL in customization page obj["url"] = emsdevice->device_type_name(); // non-translated, lower-case, used for API URL in customization page
} }
}
// add any custom entities // add any custom entities
uint8_t customEntities = EMSESP::webCustomEntityService.count_entities(); uint8_t customEntities = EMSESP::webCustomEntityService.count_entities();