UDP battery camera support:
- Baichuan UDP to support battery cameras #171
- New
bc_connectionoptional argument to main Host class - Basic UDP protocol
- Add decrypt_udp_baichuan to util
- Add encrypt_udp_baichuan to util
- Add calc_crc to util for UDP communication
- Implement offset for encrypt/decrypt_udp_baichuan
- Split out to connection classes
- Use base send method for UDP and TCP communication
- Implement UDP connection handshake
- Initial UDP acknowledgements
- Implement UDP acknowledgement
- Process UDP close message
- Handle closing UDP connection
- Catch logout error for UDP disconnects
- Check UDP message lengths and process BC messages
- Fix implementation of the send_seq_id and recv_seq_id
- Implement UDP heartbeat cmd_id 234 response
- Move client_id to protocol
- Simplify UDP datagram_received
- Check the UDP client_id of received messages
- fix: fragment baichuan UDP frames #166
- retry on send_udp timeouts
- Detect when send_udp receives wrong mess_id while waiting on it
- Move decoding of bytes out of decrypt_udp_baichuan
- Detect battery support using Baichuan
- Auto detect UDP vs TCP Baichuan connection, new bc_connection argument
- Add is_battery property
- Close battery connection when idle for 5.0 seconds
- Do not wake battery camera when requesting get_states with wake=False
- Add login_sucess to determine battery camera availability
- Block baichuan subscriptions for battery cameras
- New
Additions:
Bug fixes:
- protect against continues login attempts
- Fix keyError when parsing smart AI event
- Protect against KeyError in Baichuan get_ptz_preset
- Make encrypt_baichuan / decrypt_baichuan compatible with non-ascii chars and allow bytes input
- Fix Baichuan header lengths for non-ASCII XML
- Protection in case cmd_id 685 wakes a camera
- Check for timeout on Baichuan connection close
Optimizations:
- Combine get_value_from_xml_element and get_value_from_xml
- Fix newest mypy styling
- comment out unused net_type
- RETRY_ATTEMPTS constant
New Contributors
Full Changelog: 0.19.1...0.20.0