Stb Automator
Automated Control & Testing for Set-Top Boxes
Stb-automator allows you to issue commands to your set-top box (or whatever device you're wanting to control that takes in IR). It can then anaylze the behavior of the device and how it responds to those commands by inspecting the video output (using image recognition and OCR).
Full documentation can be found at https://stb-automator.readthedocs.io
Usage
Stb-automator is a regular python library. It does not come with a test runner or enforce a way for you to write your tests. You can use it with python's unittest or a third party library like pytest.
import stb
from pathlib import Path
# BaseFrame is a core class to inherit from so we can
# use the PageObject design pattern in our tests to ensure
# they're kept readable.
class Menu(stb.BaseFrame):
def __init__(self):
super().__init__()
@property
def is_visible(self):
return (
stb.match_image(Path('menu-banner.png')) and
stb.match_text('Menu Page')
)
def test_that_menu_key_brings_us_to_the_menu():
stb.Remote("lirc-remote").press("KEY_MENU")
assert Menu().is_visible
def test_that_settings_icon_is_in_active_state_in_menu():
remote = stb.Remote("lirc-remote")
remote.press("KEY_MENU")
stb.wait_until_visible(Menu)
remote.press_until_match("KEY_RIGHT", Path("settings-icon-active.png"))
We can then run our tests using, in this example, pytest. If the waiting for match or pressing until a match times out, an exception will be thrown and the test will fail. Otherwise, it will pass.
Installation
To install the python package, we can do so using pip.
$ pip install stb-automator
Installation Enviroment Requirements
Stb-automator requires OpenCV, LIRC, Gstreamer, and Tesseract OCR to be setup and installed already on the given system in order to work properly.
If you use Debian or a Debian derivative, there is a installation script for the prerequisites in tools/prerequisites-install-debian.sh. You will still have to figure out setup and configure for LIRC and Gstreamer. Further documentation on how to install these prerequisites and set it all up can be found at the full documentation site: https://stb-automator.readthedocs.io
Metadata
Release files for stb-automator 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stb-automator-0.1.0.tar.gz | 9.5 kB | Without provenance | Details for stb-automator-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stb_automator-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for stb_automator-0.1.0-py3-none-any.whl |
Total release size: 19.1 kB
Release files / stb-automator-0.1.0.tar.gz
| Download URL | stb-automator-0.1.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb7e44808001ee8330c0bccd9038a70dad229944413ad6130dd7d02f33e9964b
|
|
BLAKE2b-256 checksum How to use checksums |
14b9618fdf5b934b3157927927edce8a2983592a1dfee3bea8cfe33ab9105c06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.7.10 Linux/5.10.27-1-lts
|
Release files / stb_automator-0.1.0-py3-none-any.whl
| Download URL | stb_automator-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f9ecef335e010ddec88d354fb7cd65b45721f4626103bdad633068f42fefddf
|
|
BLAKE2b-256 checksum How to use checksums |
4969fe678222215dd13b01fc62cc0207bf0d1e276cbf7a0768ac7238dce6d412
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.7.10 Linux/5.10.27-1-lts
|
Security for stb-automator 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.