Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SCCP and IAX Channels #97

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cbailes78
Copy link

Hi Jordy,

Thank you for your excellent work on asterisk-hass-integration.

I have added SCCP and IAX channels to your excellent custom component. Please would you consider merging my pull request to help others.

Many thanks.

All best,
Chris.

Adding SCCP and IAX channels.
Adding SCCP and IAX channels
@TECH7Fox TECH7Fox changed the title Cbailes78 patch 1 Add SCCP and IAX Channels Feb 21, 2024
@cbailes78
Copy link
Author

cbailes78 commented Feb 21, 2024 via email

@TECH7Fox
Copy link
Owner

Hi @cbailes78,

Thank you for the PR! I don't think that IAX and SCCP devices have events for some entities like the DTMF or Connected Line entity, so those entities would do nothing. Maybe have a check like here and here and only add certain entities if the device tech type actually has those events. And the same could be done for events that only IAX or SCCP devices have. (not sure if there are any though, can't quickly find anything in the docs)

So for example something like:

# in sensor.py / binary_sensor.py
for device in devices:
  entities.append(DeviceStateSensor(hass, entry, device))
  if device.tech == "SIP" or device.tech == "PJSIP":
    entities.append(ConnectedLineSensor(hass, entry, device))
    entities.append(DTMFSentSensor(hass, entry, device))
    entities.append(DTMFReceivedSensor(hass, entry, device))

Just a example.

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.

2 participants