amaximus / transmission-card

Custom Transmission card for Home Assistant/Lovelace
MIT License
35 stars 14 forks source link

Add magnet URL not working #40

Closed etcho closed 1 year ago

etcho commented 1 year ago

The card seems to be working fine, listing torrents and everything else. But when I try to add a torrent, I get an error on Chrome's developer console:

Uncaught TypeError: Cannot read properties of undefined (reading 'state')
    at TransmissionCard._getConfigEntry (transmission-card.js?hacstag=3150444660130:118:72)
    at TransmissionCard._addTorrent (transmission-card.js?hacstag=3150444660130:113:78)
    at F.handleEvent (styles.ts:372:1)

Any ideas? I use Home Assistant Core.

Whytey commented 1 year ago

You can do this through the service that the transmission integration provides.

amaximus commented 1 year ago

@etcho I just pushed a bugfix release (0.15.1)

Please update the card, test adding magnet URL and get back to me with results.

etcho commented 1 year ago

It was hard to learn how to manually update the file, but I got it.

Same error, but on another line apparently:

transmission-card.js?hacstag=3150444660150:124 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
    at TransmissionCard._getConfigEntry (transmission-card.js?hacstag=3150444660150:124:72)
    at TransmissionCard._addTorrent (transmission-card.js?hacstag=3150444660150:119:78)
    at F.handleEvent (styles.ts:372:1)
amaximus commented 1 year ago

Could you please provide a magnet URL that I can test on? Is your transmission sensor's entity transmission? Do you set sensor_name or sensor_entity_id options in your card definition? If so, what are set to?

etcho commented 1 year ago

Any magnet URL fails, one example is magnet:?xt=urn:btih:B47FB2B675F08A14D1A8023561503C623487A57A&dn=Windows%2011%20Pro%20English%20x64%20BiT%20Activated&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.bittor.pw%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=udp%3A%2F%2Fbt.xxx-tracker.com%3A2710%2Fannounce&tr=udp%3A%2F%2Fpublic.popcorn-tracker.org%3A6969%2Fannounce&tr=udp%3A%2F%2Feddie4.nl%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Fp4p.arenabg.com%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce

Now that you mention the sensor_name or sensor_entity_id, I cannot find any sensor like this, just the sensors from the default Transmission integration. Should I have a specific sensor or entity named transmission?

I'm beginning to think that it may be something with my HA installation. Next week I'm going to install it again from scratch on a better server (HA OS this time, not Core), so I don't know if it's worth continuing to try to solve this.

etcho commented 1 year ago

After installing a new instance on a new deceive, with Hass OS this time instead of Core, the function is working fine. I'm facing other issues, but adding torrent via magnet is working.