This repository contains a script to automatically control the power output of a device using the CAT protocol. The script connects to a CAT server and adjusts the drive level to maintain a target power output.
The purpose of this repository is to provide a solution for automatically controlling the power output of a device using the CAT protocol. The script connects to a CAT server, reads the current power output, and adjusts the drive level to maintain the target power output specified by the user.
To set up and run the Docker container using the provided Dockerfile, follow these steps:
-
Build the Docker image:
docker build -t cat-auto-power . -
Run the Docker container:
docker run -e IP_ADDRESS=<your_ip_address> -e PORT=<your_port> -e TARGET_PWR=<your_target_power> cat-auto-power
To run the main.py script directly, follow these steps:
-
Set the required environment variables:
export IP_ADDRESS=<your_ip_address> export PORT=<your_port> export TARGET_PWR=<your_target_power>
-
Run the script:
python main.py
Here are some examples of how to set the environment variables and run the script:
docker run -e IP_ADDRESS=192.168.1.100 -e PORT=13013 -e TARGET_PWR=10 cat-auto-powerexport IP_ADDRESS=192.168.1.100
export PORT=13013
export TARGET_PWR=10
python main.py