tbottest.powercontrol
A module containing various additional connectors for controlling power. These are:
GpiopmControl- Power using a gpio pinPowerShellScriptControl- Power using a shell script.ShellyControl- Power using a Shelly device through shelly-ctrl.SispmControl- Power using sispmctl.TboxCtrlControl- Power using tbox-ctrl.TinkerforgeControl- Power using tinkerforge.TM021Control- Power using DH Electronic TM-021 4-fach Relaismodul dh.
- class tbottest.powercontrol.GpiopmControl[source]
Bases:
PowerControlcontrol Power On/off through a Gpio pin
Example: (board config)
from tbot.machine import board from tbottest.powercontrol import GpiopmControl class MyControl(GpiopmControl, board.Board): gpiopmctl_pin = "17" gpiopmctl_state = "1"
- class tbottest.powercontrol.PowerShellScriptControl[source]
Bases:
PowerControlcontrol Power On/off with a shell script
The shell script needs to evaluate the first parameter passed to the script. Values are:
“on” for powering on the board
“off” for powering off the board
Example: (board config)
from tbot.machine import board from tbottest.powercontrol import PowerShellScriptControl class MyControl(PowerShellScriptControl, board.Board): shell_script = "<path to shell script"
- class tbottest.powercontrol.ShellyControl[source]
Bases:
PowerControlcontrol Power On/off with a Shelly device through shelly-ctrl
https://github.com/EmbLux-Kft/shelly-ctrl
shelly-ctrl runs on the lab host, which must reach the Shelly device in its network. By default tbot uses shelly-ctrl.py from the PATH of the lab host, else shelly-ctrl from the directory shelly-ctrl in the toolsdir of the lab host. If it is in neither place, tbot clones it into this directory and installs its python dependencies into a virtual environment .venv in it, unless shelly_install is False. tbot looks for it only once per run.
Example: (board config)
from tbot.machine import board from tbottest.powercontrol import ShellyControl class MyControl(ShellyControl, board.Board): shelly_device = "192.168.1.86" shelly_id = "0"
- abstract property shelly_device: str
the Shelly device, given by IP, by MAC or by its mDNS name
This property is required.
- property shelly_command: str | None
shelly-ctrl command on the lab host. Leave unset to use shelly-ctrl.py from the PATH of the lab host, else shelly-ctrl in
shelly_tooldir(), installed there if needed. A command given here is not installed, tbot stops if it is not found.
- property shelly_tooldir: Path
directory of shelly-ctrl on the lab host, default shelly-ctrl in the toolsdir of the lab host
- property shelly_install: bool
clone and install shelly-ctrl into
shelly_tooldir()if it is in neither place, default True. With False tbot stops instead.
- class tbottest.powercontrol.SispmControl[source]
Bases:
PowerControlcontrol Power On/off with sispmctl
http://sispmctl.sourceforge.net/
Example: (board config)
from tbot.machine import board from tbottest.powercontrol import SispmControl class MyControl(SispmControl, board.Board): sispmctl_device = "01:01:5c:29:39" sispmctl_port = "2"
- class tbottest.powercontrol.TboxCtrlControl[source]
Bases:
PowerControlcontrol Power On/off through tbox-ctrl (a tbox SYSTEM Controller Modul, talking to the board over USB HID)
https://gitlab.nabladev.com/nabla/tbox/tbox-ctrl
Example: (board config)
from tbot.machine import board from tbottest.powercontrol import TboxCtrlControl class MyControl(TboxCtrlControl, board.Board): tbox_powerpin = "P1_5V_EN"
- abstract property tbox_powerpin: str
the tbox-firmware pin to switch, e.g. “P1_5V_EN”, “P2_12V_EN”, “P3_24V_EN”, … (see tbox-firmware/src/pins.h for the full list)
This property is required.
- class tbottest.powercontrol.TinkerforgeControl[source]
Bases:
PowerControlcontrol Power On/off with Tinkerforge
Example: (board config)
from tbot.machine import board from tbottest.powercontrol import TinkerforgeControl class MyControl(TinkerforgeControl, board.Board): channel = "" uid = ""
- class tbottest.powercontrol.TM021Control[source]
Bases:
PowerControlcontrol Power On/off with DH Electronics TM-021 4-fach Relaismodul
https://www.dh-electronics.com
Example: (board config)
from tbot.machine import board from tbottest.powercontrol import TM021Control class MyControl(TM021Control, board.Board): tm021_device = "/dev/relais" tm021_baudrate = "500000" tm021_timeout = "5" tm021_address = "0" tm021_port = "1" tm021_debug = False