mendevi.measures.adecwatts¶
Get the power consumption of as usb plugded ADEC WATTS wattmeters.
Classes
|
Extract the activity of a ADEC-WATTS wattmeter connected to serial usb port. |
Details
- class mendevi.measures.adecwatts.ADECWattmeter(port: str | None = None, *, no_fail: bool = False)[source]
Extract the activity of a ADEC-WATTS wattmeter connected to serial usb port.
Examples¶
>>> import time >>> from mendevi.measures.adec import ADECWattmeter >>> with ADECWattmeter() as usage: ... time.sleep(1) ... >>>
Initialize the usage context.
Parameters¶
- portstr, default=autodetect
The port to listen on. In gerenal it is “/dev/ttyUSB0”. By default, it is autodetected using :py:meth`guess_port`.
- no_failbool, default=True
If False, raise RuntimeError if it fails to get the ADEC measure. Otherwise (if True), return None instead of failing.