palazzem / econnect-python

API adapter used to control programmatically an Elmo alarm system
BSD 3-Clause "New" or "Revised" License
8 stars 5 forks source link

Refactor query() API so that a raw query (dict) is returned; add "excluded" field to returned dict #72

Closed palazzem closed 2 years ago

palazzem commented 2 years ago

Overview

Follow-up of #71 Closes #57

Removes any filtering logic from client.query() API who will be implemented in another component to keep the connector lightweight. In this case, a dict with selected fields are returned, instead of returning multiple items. This simplifies the API that can be used as a building block for a more complex logic.

Returned dict has the following structure:

{
    "id": 1,
    "index": 0,
    "element": 3,
    "excluded": False,
    "name": "Kitchen",
}

This PR adds excluded field that can be used to retrieve system input exclusion status.

codecov-commenter commented 2 years ago

Codecov Report

Merging #72 (416c6c9) into master (d33ce99) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #72   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          271       265    -6     
=========================================
- Hits           271       265    -6     
Impacted Files Coverage Δ
elmo/api/client.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d33ce99...416c6c9. Read the comment docs.