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 media player via room api #22

Merged
merged 3 commits into from
Sep 3, 2024
Merged

Conversation

nalin29
Copy link

@nalin29 nalin29 commented Mar 20, 2024

Adds Room based audio. Need to fall back on data coordinator as Room does not support websocket. But we can just create 2 entities for this an old coordinator one used by rooms and websocket for the rest

@lawtancool
Copy link
Owner

Hi @nalin29, thanks for submitting this! I won't be able to review and test this for a little while, but I wanted to ask if you know why the room doesn't support websocket? The Control4 mobile app and the Control4 touchscreens use the websockets for state updates, so in theory it should be possible. I would like to avoid re-introducing the DataCoordinator if at all possible.

@nalin29
Copy link
Author

nalin29 commented Apr 5, 2024

@lawtancool I did digging on this when I tried to implement first with websockets. There is no actual room object to subscribe to for events. The way it seems to work is that it will get various updates across multiple devices. So the device for media player will contain an update that it is playing in that room. Then there might be a separate device like the audio matrix mentioning the stats for the different connections like audio and input now. Its just a mess and quite hard to parse. I don't know if the app has some hidden api that makes this easier. The data coordinator is significantly simpler as we can treat each room as an object and query its state, instead of trying to piece it together.

This was linked to issues Sep 1, 2024
Added HA grouping support by setting group entities to same C4 RoomSource

Added media image, artist, album, etc. info

Added device area and extra state attributes to CoordinatorEntity

Added scan interval to options flow
@lawtancool lawtancool merged commit ca5b1f8 into lawtancool:master Sep 3, 2024
@lawtancool
Copy link
Owner

Hey @nalin29, I added some features to your branch and merged the PR, let me know how it works on your system!

  • Added HA grouping support by setting group entities to same C4 RoomSource
  • Added media image, artist, album, etc. info
  • Added device area and extra state attributes to CoordinatorEntity
  • Added scan interval to options flow
  • Only set up room entities that have valid experiences (listen, video)

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.

Add Media for this custom version Adding Media Player Support
2 participants