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

query() API returns also "last_id" field; items are grouped under "sectors" or "inputs" keys #73

Closed palazzem closed 2 years ago

palazzem commented 2 years ago

Overview

Returned object has the following structure:

{
"last_id": 4,
"sectors": {
    0: {
        "element": 1,
        "id": 1,
        "index": 0,
        "excluded": False,
        "name": "Living Room",
    },
    1: {
        "element": 2,
        "id": 2,
        "index": 1,
        "excluded": False,
        "name": "Bedroom",
    },
    2: {
        "element": 3,
        "id": 3,
        "index": 2,
        "excluded": False,
        "name": "Kitchen",
    },
}

# or

{
"last_id": 4,
"inputs": {
    0: {
        "element": 1,
        "id": 1,
        "index": 0,
        "excluded": False,
        "name": "Living Room",
    },
    1: {
        "element": 2,
        "id": 2,
        "index": 1,
        "excluded": False,
        "name": "Bedroom",
    },
    2: {
        "element": 3,
        "id": 3,
        "index": 2,
        "excluded": False,
        "name": "Kitchen",
    },
}
codecov-commenter commented 2 years ago

Codecov Report

Merging #73 (bb2095d) into master (188da6b) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #73   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          265       268    +3     
=========================================
+ Hits           265       268    +3     
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 188da6b...bb2095d. Read the comment docs.