I would like to ask if it is possible to get inside the code of a device class such information as commands, attributes and name of this device. I understand that it is possible in case of getting data from other devices using device proxy. But what about a device getting its data from itself?
You say that you want to get it from within the device itself. I assume you don’t know the names of these fields, or want to do it programmatically for some reason.
Expanding on Reynald’s answer, at runtime a device instance can query itself with self.get_device_class(), which gives all the details about commands, attributes, properties, etc. This can be done without a DeviceProxy.
Similarly, at runtime a device instance can query its own name with self.get_name().
A while back a colleague of mine was experimenting in order to extract the API of the device from the Python code statically. I.e., without executing the device. The idea was to be able to make something like a Pogo XMI file directly from the Python source code. It was never completed, but the commands, attributes and device properties could easily be extracted. The example code is here: