eavanvalkenburg / pysiaalarm

A python package to connect to a SIA DC-09 based alarm system.
MIT License
39 stars 29 forks source link

How to add new value to AMD-CID mapping (adm_mapping.json) #57

Closed cartamatt closed 1 day ago

cartamatt commented 10 months ago

I'm using your code installing your library with pip and your example file pysiaalarm/tests/run.py, and I don't understand how can I add new values to the mapping file adm_mapping.json. This is what I receive in my logs:

WARNING:pysiaalarm.base_server:Code not found, replying with DUH to account: 5555
DEBUG:pysiaalarm.base_server:Incoming line: A7C70040"ADM-CID"0224L000000#5555[#5555|3407 01 503]_09:06:27,01-15-2024
DEBUG:pysiaalarm.event:Content matches: {'account': '5555', 'event_qualifier': '3', 'event_type': '407', 'partition': '01', 'ri': '503', 'xdata': None, 'timestamp': '09:06:27,01-15-2024'}
WARNING:pysiaalarm.base_server:Code not found, replying with DUH to account: 5555
DEBUG:pysiaalarm.base_server:Incoming line: 778C0040"ADM-CID"0225L000000#5555[#5555|1456 01 503]_09:06:27,01-15-2024
DEBUG:pysiaalarm.event:Content matches: {'account': '5555', 'event_qualifier': '1', 'event_type': '456', 'partition': '01', 'ri': '503', 'xdata': None, 'timestamp': '09:06:27,01-15-2024'}
Evento ricevuto: Content: #5555|1456 01 503]_09:06:27,01-15-2024, Zone (ri): 503, Code: CG, Message: , Account: 5555, Receiver: None, Line: L000000, Timestamp: 2024-01-15 09:06:27+00:00, Length: 0040, Sequence: 0225, CRC: 778C, Calc CRC: 778C, Encrypted Content: None, Full Message: "ADM-CID"0225L000000#5555[#5555|1456 01 503]_09:06:27,01-15-2024.

In here you can see that event_type 456 works and event_type 407 doesn't, 407 is the one that I want to add, how can I do this?