JasonCarter80 / concord232

Apache License 2.0
22 stars 17 forks source link

ZONE_STATES[16] #10

Open aaronsp777 opened 6 years ago

aaronsp777 commented 6 years ago

There is a typo in concord_commands.py:

I recommend the following change.

ZONE_STATES = { 0: NORMAL, 1: TRIPPED, 2: FAULTED, 4: ALARM, 8: TROUBLE,

Furthermore these are bit fields. How to repro: 1) Open Door. 2) Arm panel, 3) Press "#" on panel to arm despite protest. 4) Status comes back as 17 (TRIPPED+BYPASSED). If you close the door, the status comes back as 16 (Just bypassed)

JasonCarter80 commented 6 years ago

Feel free to make a pull request with the updates, otherwise it might be some time before one of us gets to it.

aaronsp777 commented 6 years ago

Ok. Thanks. I know how to clone and check in on my own branch but I don't know how to do a pull request. I'll try to figure out github. Thanks.

On Mar 22, 2018 7:58 AM, "Jason Carter" notifications@github.com wrote:

Feel free to make a pull request with the updates, otherwise it might be some time before one of us gets to it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JasonCarter80/concord232/issues/10#issuecomment-375336872, or mute the thread https://github.com/notifications/unsubscribe-auth/AHWcbQM0PNvjkyN_D_SMpLUtqOK7o2RPks5tg7wkgaJpZM4Sn_VM .

AZDane commented 5 years ago

In reality it should be handled as a binary instead. Typically you will have a combination - For example Tripped AND Alarm, so that would be a status_code 5

bit 0: 1 = tripped bit 1: 1 = faulted bit 2: 1 = Alarm bit 3: 1 = Trouble bit 4: 1 = Bypassed