This update refines the query() method in the client, which fetches synchronized data between the main unit and the cloud (using _get_descriptions() under the hood). Issues arise when strings are not in sync, specifically when:
The central unit has defined and InUse outputs, inputs, or sectors.
The cloud is not in sync, leading to missing keys (9, 10, or 12) in _get_descriptions(), causing a KeyError.
To address this, we've implemented a safer access via the dictionary get() method. Now, if a string is missing, Unknown is returned instead of an error.
Testing:
Test with a central unit where an output is InUse, but no strings are configured in the cloud.
Extra Notes (optional):
n/a
Checklist
[x] Related issues and proposed changes are filled
[x] Tests are defining the correct and expected behavior
Related Issues
Proposed Changes:
This update refines the
query()
method in the client, which fetches synchronized data between the main unit and the cloud (using_get_descriptions()
under the hood). Issues arise when strings are not in sync, specifically when:InUse
outputs, inputs, or sectors._get_descriptions()
, causing aKeyError
.To address this, we've implemented a safer access via the dictionary
get()
method. Now, if a string is missing,Unknown
is returned instead of an error.Testing:
Test with a central unit where an output is
InUse
, but no strings are configured in the cloud.Extra Notes (optional):
n/a
Checklist