Why can I 'enable' a non present Wifi device in LuCI?

I've noticed that I can click on 'enable' for device in LuCI if there's existing config in /etc/config/wireless even for devices that aren't present in the platform - e.g when they've been unplugged from USB. The 'Enable' button will change to 'Disable' despite the device not being present. Is this expected behaviour?

It would be great if LuCI could determine if a device was non-present and disable or not show the device - is something that is coming in a newer release or is my installation not behaving correctly?

Also is there any UCI command that can be used to detect if a device is present? And when does OpenWRT create the 'managed' interface device (e.g. wlan0) for a phy device present in the system - only when the device is 'enabled' or at other times?

I'm running LuCI Master (git-18.107.34297-084499a)/ OpenWrt SNAPSHOT, r6871+4-0167f53b9d on a Raspberry Pi3B+

UCI, not that I know of, as, to the best of my knowledge, UCI "looks at" the config files. ubus, on the other hand, as far as I know, can be used to query the current state of the system.

LuCI looks at the inverse state of the disabled uci property. Checking for actual presence of the hardware is not easily doable, mainly due to a lack of proper system APIs.

Yeah sorry I meant ubus - I noticed that LuCI only seems to check the value of disabled but it wasn't clear what was going on in the netifd subsystem to check for the presence of the device before allowing disabled to change?

It is quite possible to check for the presence of the device by matching on the existence in the system of the path parameter from /etc/config/wireless for each particular device - this is presumably how netifd manages to find the device and activate it - if it does indeed exist but if it doesn't it seems to quietly (I couldn't find error logs from netifd?) 'succeed' which is weird?