class Monitor – information about connected monitors
The monitor.Monitor class provided information about monitors connected to the
DL-7450. Applications should not need to create Monitor objects, but they may be
returned from various dock
module interfaces, such as dock.DockInfo.
For example:
from dock import DockInfo
from splashscreen import Splashscreen
screen = Splashscreen()
info = DockInfo()
monitors = info.monitors()
text = []
for monitor in monitors:
if monitor.valid():
text.append(f"{monitor.name()} {monitor.preferred_mode()}")
else:
text.append("No monitor")
screen.add_text_box(text)
Constructors
- class monitor.Monitor(edid)
Construct a Monitor object. The input parameter is a
bytearray
representing the EDID from the monitor. Note, monitors do not always present a valid EDID, so always check theMonitor.valid
method before any other details.
Methods
- Monitor.name()
The manufacturer’s recognisable name for this monitor.
- Monitor.preferred_mode()
The preferred screen resolution for this monitor. The return value is a pair
(width, height)
.
- Monitor.serial_number()
The serial number for this monitor. The return value is an
int
, based on the four byte representation in the underlying EDID.
- Monitor.valid()
Check whether the EDID of this monitor is valid. If
False
, all other methods of this class will return empty data.