Skip to content

Cleanup#10

Merged
Kannix2005 merged 2 commits into
mainfrom
cleanup
Mar 8, 2026
Merged

Cleanup#10
Kannix2005 merged 2 commits into
mainfrom
cleanup

Conversation

@Kannix2005
Copy link
Copy Markdown
Owner

This pull request introduces several improvements and fixes to the Siedle Home Assistant integration, focusing on reliability, maintainability, and better SIP protocol handling. The most notable changes include improved cleanup on integration removal, more robust SIP transport handling, automatic reloads on option changes, and enhanced connection logging.

Integration lifecycle and cleanup:
SIP protocol and connection improvements:
Event handling and UI responsiveness:
Internal API and callback improvements:

Copilot AI review requested due to automatic review settings March 8, 2026 08:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces several improvements to the Siedle Home Assistant integration focused on reliability and maintainability. The changes centralize SIP transport string logic, capture actual socket addresses after connection for accurate SIP headers, add file cleanup on integration removal, enable automatic reloads on option changes, and dispatch connection update signals from the FCM handler.

Changes:

  • Refactored SIP transport string logic into a transport_str property on SipConfig, replacing 7 duplicate inline conditionals and fixing a bug where TCP transport was previously treated as UDP
  • Added async_remove_entry for cleaning up persistent files (FCM credentials, token caches) on integration removal, and added an options change listener that triggers integration reload
  • Enhanced FCM handler to dispatch SIGNAL_SIEDLE_CONNECTION_UPDATE on connection status changes for immediate binary sensor updates

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
custom_components/siedle/sip_manager.py Added transport_str property, replaced inline transport conditionals, captured actual local IP/port from sockets, enhanced connection/registration logging
custom_components/siedle/fcm_handler.py Added dispatcher signal dispatch on FCM connection/disconnection events for immediate UI updates
custom_components/siedle/__init__.py Added options change reload listener, async_remove_entry cleanup, simplified call_ended call to pass full data dict

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread custom_components/siedle/sip_manager.py
Comment thread custom_components/siedle/sip_manager.py
Comment thread custom_components/siedle/sip_manager.py
Comment thread custom_components/siedle/sip_manager.py
@Kannix2005 Kannix2005 merged commit db2338f into main Mar 8, 2026
6 checks passed
@Kannix2005 Kannix2005 deleted the cleanup branch March 8, 2026 08:58
@henningw
Copy link
Copy Markdown

henningw commented Mar 8, 2026

Just a comment - Instead of reimplementing just another SIP stack, I would suggest that you use a existing SIP library. You will make your life much easier this way. There is e.g. pjsua available as python library link
This library is used in many phones and other SIP services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants