ryanolf / node-sonos-nfc

Access your streaming music through physical NFC tokens, like putting on a CD or record. Great for children and adult aesthetics.
MIT License
36 stars 14 forks source link

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

Open ignasiduelo opened 2 weeks ago

ignasiduelo commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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.

ryanolf commented 2 weeks ago

I think making cards compatible between different implementations is compelling. I’d rather you not have to reprogram your cards. I don’t really see a downside to parsing each line as a command.

I’ll take a look when I’m back on my computer.

On Fri, Nov 8, 2024 at 5:12 PM Ignasi Duelo @.***> wrote:

Closed #18 https://github.com/ryanolf/node-sonos-nfc/pull/18.

— Reply to this email directly, view it on GitHub https://github.com/ryanolf/node-sonos-nfc/pull/18#event-15220665554, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJSBSSF2W6D3NFH6JFKY4DZ7TWGHAVCNFSM6AAAAABRNRLFV6VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVGIZDANRWGU2TKNA . You are receiving this because you commented.Message ID: @.***>

ryanolf commented 2 weeks ago

What is the other tool that works this way? I wonder if there are other commands or differences we want to consider.

On Fri, Nov 8, 2024 at 6:53 PM Ryan Olf @.***> wrote:

I think making cards compatible between different implementations is compelling. I’d rather you not have to reprogram your cards. I don’t really see a downside to parsing each line as a command.

I’ll take a look when I’m back on my computer.

On Fri, Nov 8, 2024 at 5:12 PM Ignasi Duelo @.***> wrote:

Closed #18 https://github.com/ryanolf/node-sonos-nfc/pull/18.

— Reply to this email directly, view it on GitHub https://github.com/ryanolf/node-sonos-nfc/pull/18#event-15220665554, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJSBSSF2W6D3NFH6JFKY4DZ7TWGHAVCNFSM6AAAAABRNRLFV6VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVGIZDANRWGU2TKNA . You are receiving this because you commented.Message ID: @.***>