Giter VIP home page Giter VIP logo

Comments (2)

baunan avatar baunan commented on June 21, 2024

Any updates on thisone? I have two alarm system linked to the user id and this addon only pickup one of them and unfortunalty for me the wrong one. The Python script I used, doesn't work anymore, but this add-on does, but is targeting the wrong alarm system. What do I need to lock this addon to a specific alarm id?

From what I can see from the log, the command Request with get: https://mypagesapi.sectoralarm.net/api/account/GetPanelList list both alarm systems. But the sensors for the first one (the one with the lowest ID number) is not generated.

from sector.

baunan avatar baunan commented on June 21, 2024

Based on the log debug print, it turns out that the data variable is not updated correctly when it loops through the alarm systems. Only the last alarm system data is added.

        for panel in response_panellist:
            data: dict[str, Any] = {panel["PanelId"]: {}}
            data[panel["PanelId"]]["name"] = panel["DisplayName"]
            data[panel["PanelId"]]["id"] = panel["PanelId"]
            data[panel["PanelId"]]["alarmstatus"] = 0

I am rusty in programming, but I changed it so that the data dictonary is update when it goes through the pannellist loop and now both of my alarms systems are being seen,

data2 = {}
for panel in response_panellist:
    data1: dict[str, Any] = {panel["PanelId"]: {}}
    data1[panel["PanelId"]]["name"] = panel["DisplayName"]
    data1[panel["PanelId"]]["id"] = panel["PanelId"]
    data1[panel["PanelId"]]["alarmstatus"] = 0
 
    data2.update(data1.copy())
    data: dict[str, Any] = data2 

from sector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.