`logging.basicConfig` doesn't work when run via `uvicorn`.
I now explicitly get the root logger and set its level to INFO,
which means we now see logs on the terminal.
Retrieving metadata pre-action risks stale metadata being
returned if DirectThingClients are used. I've switched to
the safer callable dependency, which is guaranteed to be fresh.
Connect looks for /routes and /api/v2/streams/snapshot
These are now present and working.
I've also hard coded the static files directory - fixing this
properly is a work in progress.
Previously, we raised an exception (and thus HTTP error
code) if the CSM matrix was requested and not yet set.
Now, we just return None, and I've added a (not-network-exposed)
function that will raise an HTTPException if it's missing.
It's helpful to raise an exception if we access the calibration
before it's been set - but thing state should not raise exceptions,
just return an empty dict if the data is not there yet.
Currently only has fast_autofocus, and there
may be some work to do on timing, but it works :)
Getting timestamps from the camera rather than
time.time() would be ideal, but it would take some thought to tie that up with
the encoder.
I'm using a low-res stream, as it seems impossible to
turn the bitrate control of the MJPEG stream off,
at least within the picamera2 API.
I've refactored the CI substantially, using the
new `extends` keyword to tidy it up a lot.
I have also changed from running the Python
tests on Python:3.7 to using a Raspberry Pi
OS from the Balena project.
This means we are now ONLY locking
dependencies for the Pi, and we are no longer
expecting the Pipfile to work on non-arm
systems.
Including both piwheels and pypi in Pipfile caused hash mismatches,
which caused installation to fail. I've removed pypi, but this may
break installation on other platforms.
I may need to duplicate Pipfile and Pipfile.lock, one for Pi and
one for non-Pi platforms.
I can confim this commit installed successfully on a Pi.
I couldn't install this on a Pi, because it incorrectly chose
versions of e.g. numpy that did not exist in binary form for the
pi. I re-locked dependencies with:
`PIP_ONLY_BINARY=":all:" pipenv lock --dev`
This forced the use of wheels, and not only completed but did so
in ~10 minutes.
OpenAPI validation seems to have become stricter about checking for None defaults
in parameters that don't allow None. I have
modified two things as a result:
1. StageTypeProperty (used to pick between SangaStage and SangaDeltaStage)
now defaults to SangaStage (which is the
original behaviour anyway)
2. It is now allowed to pass x,y,z=None when making a move - this is the same as
not passing the respective argument, so the
function already correctly handled this case.
The `thing-context` definition used a 2019 draft of how to specify a
tuple (where `items` set the mandatory items and `additionalItems`
set the rest). These have been renamed to `prefixItems` and `items`
respectively, and I have applied this change. Schema now validates
again :)