The 'gattserverdisconnected' event is called before the device is
actually disconnected, so if the user tries to connect again
immediately, the web browser will show a still "paired" device, but
selecting this devices results in an infinite wait. This is a bug in
Chromium, but we can work around it by adding a delay to give BlueZ
time to actually disconnect the device.
Closes: https://github.com/pybricks/support/issues/600
Instead of rendering the toaster separate from the main index, add it
there so we can inherit all of the context providers. This requires
passing the ref object instead of the toaster instance itself, so
sagas have to be updated.
This adds support to the BLE Pybricks Profile v1.2.0. This includes a
new method to download and run programs and a new file format for the
user program.
Code for the old download and run is kept for backwards compatibility.
However, the PnP ID characteristic is no longer optional, so the
minimum Pybricks Profile is now v1.1.0.
This might help with some people that have connection issues where the
OS is still busy enumerating the device when we are trying to read
characteristics.
This removes use of the pseudo-internal toString() function and also
removes extraneous uses of ReturnType<>. Also, a new when() method
is added to simplify additional uses.
The pattern we were using for actions required actions to be defined in
three places, an enum member containing the type string, an type
definition and a function. This combines all three of these into one by
using a helper function based on the ideas from [1].
[1]: https://phryneas.de/redux-typescript-no-discriminating-union
This adds a basic battery indicator that just shows green for OK and red
for low battery warning. This is all we can do for now since that is
the only information that the hub sends currently.
Fixes: https://github.com/pybricks/support/issues/559
This adds an indicator to the status bar that shows the hub name. When
clicked, a popover will be displayed that lists more detailed information
about the connected hub.
This adds a firmware version check that shows an error message if the
connected hub is running an older Pybricks firmware version.
Issue: https://github.com/pybricks/support/issues/482
The Pybricks firmware now includes the BLE Device Information Service
to provide firmware and Pybricks protocol versions.
For now, checking that the service is present is enough to know that the
firmware is up to date. But we will need to add additional checks as
soon as the protocol is changed.