Video games blended with home automation. Control your IoT devices based on in-game statuses!
Control your home based on any horizontal rectangles by using simple screenshots.
pip install -r requirements.txt
Currently there is no input sanitation or verification, so drifting from the guidlines below will likely break the script.
change_threshold
is passed
quadrant_capture_count
and quadrant_number
were implemented as a way to help save computer resources and prevent false positives. The reasoning behind it is, if a user only cares about the bottom left corner of the screen, why save the whole screen in memory and process it if we don't need to?
quadrant_capture_count
can be either 1, 2 or 4. 1 tells the script that we only care about a single quadrant (top left, top right, bottom left, bottom right). 2 tells the script we care about 2 quadrants (either top or bottom). 4 is all 4 quadrants, or in other words, the entire screen.quadrant_number
should change depending on the value of quadrant_capture_count
.
quadrant_capture_count = 1
, quadrant_number
should be 1-4 (1 = top left, 2 = top right, 3 = bottom left, 4 = bottom right)quadrant_capture_count = 2
, quadrant_number
should be 1-2 (1 = top half, 2 = bottom half)quadrant_number
is unused when quadrant_capture_count = 4
(because it's the whole screen)scan_interval
and change_threshold
, performance will be better and you won't slam the API endpoint.The image above shows a visible rectangle being drawn around the script detected rectange. You can uncomment lines 35, 46-50 in the WidthWatcher module to draw a similar rectangle for your application. Good for troubleshooting.
As your health (or mana, or anything) gets smaller, the invisible rectangle gets smaller. This updates at the scan_interval
rate.
The script will then fire off the RESTful API calls based on the settings you define in the configuration file.