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

feat:add support to store multiple commands in NFC card #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ignasiduelo
Copy link

@ignasiduelo ignasiduelo commented Nov 8, 2024

This adds support to store multiple commands in NFC card in text feld separated by line breaks, allowing things like storing a room change in a card and then playing an album from a particular track, such as:

room:Den
spotify:playlist:5B8etHA3kzgOZ5Pdz2FAVe
command:trackseek/2

@ryanolf
Copy link
Owner

ryanolf commented Nov 8, 2024

Hi @ignasiduelo, thanks for the PR! I think this feature sounds reasonable, but I'm not sure it adds much over what you can already do, which is have each command in its own record. Each card can have multiple records. What lead you to do this instead of using multiple records?

@ignasiduelo
Copy link
Author

Ah you're totally right.
I was using another tool that only read the first text record, so I went this route. But yep, you're right it makes no sense.

@ignasiduelo ignasiduelo closed this Nov 8, 2024
@ryanolf
Copy link
Owner

ryanolf commented Nov 8, 2024 via email

@ryanolf
Copy link
Owner

ryanolf commented Nov 8, 2024 via email

Copy link
Owner

@ryanolf ryanolf left a comment

Choose a reason for hiding this comment

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

If you can fix the one redundant call, this seems fine to merge.


for (const command of lines) {
await process_sonos_command(command);
}

await process_sonos_command(received_text);
Copy link
Owner

Choose a reason for hiding this comment

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

I think this call is redundant (in the case of a single line) and an error (in the event of multiple lines.

@ryanolf ryanolf reopened this Nov 11, 2024
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