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

Deal with room changes #24

Merged
merged 1 commit into from
Apr 19, 2021
Merged

Deal with room changes #24

merged 1 commit into from
Apr 19, 2021

Conversation

AaronDavidSchneider
Copy link
Owner

This issue is supposed to tackle the room current roomchange issue as outlined in #21.

To achieve this, I had to:

  • rework the device structure
  • clean up the code

Closes #21

@AaronDavidSchneider
Copy link
Owner Author

I would love to hear your feedback @rasmusbe and @christianschneider89!

@christianschneider89
Copy link

Works for me! Thanks!

@rasmusbe
Copy link
Contributor

Looks good! Great job!

@AaronDavidSchneider AaronDavidSchneider merged commit 9c64e63 into master Apr 19, 2021
@rasmusbe
Copy link
Contributor

rasmusbe commented Apr 19, 2021

One more question I noticed now when I trying it:
Right now the alarm gets the entity id:
switch.sonos_alarm_1_2 where 1 is speaker id 1 (Bedroom) and 2 is alarm Id.

Is it possible to set the entity id to switch.sonos_alarm_bedroom_2 instead or will that mess up the room changes?

@AaronDavidSchneider
Copy link
Owner Author

Thanks for getting back!

Right now the alarm gets the entity id:
switch.sonos_alarm_1_2 where 1 is speaker id 1 (Bedroom) and 2 is alarm Id.

Could you please test if that persists when you readd the integration? It sounds to me that this is due to the reworking of the devices.

Is it possible to set the entity id to switch.sonos_alarm_bedroom_2 instead or will that mess up the room changes?

The idea right now is that we use the alarm ids as only basis for the unique_id. Since that one doesn't change upon room changes. We can therefore easily track the alarm itself as it changes room names, etc.

The entity id is therefore in fact only a composition of the alarm_id

self._id = alarm._alarm_id
_entity_id = slugify("sonos_alarm_{}".format(self._id))

TLDR:
I think this update of the component requires the user to readd the integration.

@AaronDavidSchneider
Copy link
Owner Author

Did it work upon readding the itegration @rasmusbe? (see my comment above)
As soon as it does, I will release it

@rasmusbe
Copy link
Contributor

I will try it tomorrow, unable to try it today unfortunately

@rasmusbe
Copy link
Contributor

Re-adding did solve it, I made some changes in #25 to, in my opinion, improve the device info a bit.

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.

Handle room changes
3 participants