Git Product home page Git Product logo

transmission-card's People

Contributors

amaximus avatar blenderistdev avatar colino17 avatar fustom avatar heedfulcrayon avatar jondycz avatar royto avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

transmission-card's Issues

Feature Request: Switch

Nice card!

Any chance you could/ would add the transmission switches "turtle mode and pause" to the card?

Also the feedback that is presented on the torrent in the web ui would be cool to.

Great work!

Overcomplicated

Hello,

I am using your card and works and looks well. Thank you for your great job.

However, where are you going with it? From a simple useful card to command center for torrents?

The problem that I have with this, is on android home assistant app, card is larger then the screen. Now I can sift all my cards left and right because of this last field that you added (total / active / completed / started). This happens when you switch through them.

I used the options to hide stuff for now it's fine, just consider it please.

Another thing with this toggle is when you press to switch to a new view for example from total to active there is a considerable delay.

Add i18n support

I would like to translate the card to Brazilian Portuguese, could you add i18n support?

Add magnet URL not working

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.

Transmission entity default name issue

Hi
I want to report a little issue on code :(

This card works with an predefined entity, called sensor.transmission_ectect
If I want change the name of transmission entity, or I want to add another transmission device with another name, this card does't work :(

Line 10: if (typeof hass.states[**'sensor.transmission_'** + ttype + '_torrents'] != "undefined") {

I want help you but I don't know so good JS, but i think that u can take the name of entity from an option called entity (for example sensor.transmission_active_torrents) or other sensor.transmissionname and report into if with a simple variable :)

Thank u so much for your work 👍

Feature Request: Show ratio

Please if you can add a field where the current ratio is shown for every torrent.
In my opinion this is all that is missing to be perfect.

Different sensor names on languages other than English

I was struggling for some time trying to understand why my card couldn't read information from the sensor, even though I could add torrents using the text field on the card. The sensors worked just fine, but the card couldn't see them.

Searching on transmission-card.js for "no sensor" (the only information I was able to get from the card), I ended up discovering that the card expects a sensor named transmission_download_speed. What I didn't notice was that my Portuguese installation of hass translated the sensor names when I installed the transmission integration. So, almost all of the transmission sensors were written in Portuguese, which obviously causes issues with the card. So I looked for the original sensor names on the official page of the transmission's integration and changed them, and everything worked just fine.

I know the problem was on my side, but from an user's point of view, it can be hard to notice this kind of thing. Adding the possibility to set the name of all sensors separately on the card configuration could be a solution, but doesn't sound very practical. If this information (that the sensor names must be the same as the official English names) was displayed on the readme.md I think it would help a lot during the troubleshooting process.

Sensor names are changed in HA

The sensor names are changed with the following (merged and included to release from HA 2023.8.0b0) pull requests: https://github.com/home-assistant/core/pull/96761/files and https://github.com/home-assistant/core/pull/84664/files

I've got entities named:

  • sensor.transmission_active_torrents
  • sensor.transmission_completed_torrents
  • sensor.transmission_download_speed
  • sensor.transmission_paused_torrents
  • sensor.transmission_started_torrents
  • sensor.transmission_status
  • switch.transmission_switch
  • sensor.transmission_total_torrents
  • switch.transmission_turtle_mode
  • sensor.transmission_upload_speed

You may have to implement some IF conditions to keep backward compatibility but support HA > 2023.08.0.

no sensor

image

I get this text with active torrents.
Maybe its because of name of integration?
sensor.smartbox_active_torrents

Change in transmission integration

Since Home Assistant 2022.12.7 I started getting this warning

The name key in Transmission services is being removed
Update any automations or scripts that use this service and replace the name key with the entry_id key.

More customisation options

Nice card!

It would be nice to be able to also show/hide:

  • Upload Speed
  • Download Speed
  • Card Title
  • Percentage

And also be able to customize these colors to fit the card in any lovelace-theme:

  • Progress bar background
  • Progress bar fill
  • Progress bar text

Cheers!

Add an option to add torrent through a file

Here is some prototype code. Though it doesn't work since the second function is asynchronous and the Hass object is out of its scope. Currently lacking braincells to come up with a solution. The first function is called using an onclick event from a button, that could be positioned on the right side of the input field.

  _addTorrentViaFileButton(event) {
    var x = document.createElement("INPUT");
    x.setAttribute("type", "file");
    x.addEventListener("change", this._addTorrentViaFile);
    x.click();
  };
  
  async _addTorrentViaFile(event) {
    let base64string = await new Promise((resolve) => {
      let file = event.currentTarget.files[0];
      const fileReader = new FileReader();
      fileReader.readAsDataURL(file);
        fileReader.onload = () => {
            resolve(fileReader.result);
        };
    });
    this.hass.callService('transmission', 'add_torrent', { entry_id: `${this._getConfigEntry()}`, torrent: base64string });
  };

Perhaps one way of doing it would be changing the value of the input field to the calculated base64 value and then using this to emulate the Enter keyboard event
https://stackoverflow.com/questions/3276794/jquery-or-pure-js-simulate-enter-key-pressed-for-testing

Card not showing

Card not showing in lovelaсe panel. If I go to the integration menu item, the card becomes visible until the page is refreshed. Home Assistant 2023.3.6
torr1

Cannot convert undefined or null to object

Hi
Please can you check this piece of code?
_getTorrents(hass) { var res = []; if (typeof hass.states['sensor.transmission_total_torrents'] != "undefined") { const data1 = hass.states['sensor.transmission_total_torrents'].attributes['torrent_info']; Object.keys(data1).forEach(function (key) { res.push({ name: key, id: data1[key].id, percent: parseInt(data1[key].percent_done, 10), state: data1[key].status, added_date: data1[key].added_date, }); }); } return res; }
When transmission is closed or unreachable this will cause to not render lovelace view

image
Can you check for undefined?

Thank you very much

Request: Option to hide the torrent list

It would be nice to be able to hide the torrent list, I currently have a card set up to add magnet links and show the up and down speeds but would like to not have the torrent list keep changing the size of the card.

A few suggestions

Hi,
Thanks for the great work!
Could you add some functions like:
show/hide turtle mode button
show/hide start/stop button
torrents list options (seems sensor.transmission_total_torrents is default) like sensor.transmission_active_torrents

'no torrents' while 39 are actually active

I have just created the card, but it says "no torrents' under every setting. However, if I check my transmission sensors, they are all showing active torrents etc.

Is there something I'm missing during config?

Round speed sensor

How I can make sensor speed number shorter?
Screenshot_2023-07-04-18-05-58-88_c3a231c25ed346e59462e84656a70e50.jpg

Like 0.2 MB/s instead 0.239777 MB/s

Download folder selection

Hi there, I would ask your help to define the destination folder of the torrent while adding. E.g. I'm usually adding files to Plex, and "Movies" and "Tv Series" folders are differently scraped. That's why I would sort the different files to the proper folders.
Thanks in advance for your help

Undefined

Card appears as "undefined" if there are no torrents downloaded in the client.

Error handling for Transmission sensors that do not use default naming convention

Thanks for this card, this is much better than the makeshift card I created using Markdown and templates. I had issues setting up the Transmission card initially and noticed my Lovelace dashboard would fail to load. I guessed that the issue had something to do with my messed up Transmission sensor names (I had to re-add the integration, and it created duplicate sensors called 'switch.transmission_turtle_mode_2', etc. I renamed the sensors back to their default naming and the Transmission card works now!

Would it be possible to add in some error handling to check the sensor names, so that it doesn't crash the entire Lovelace dashboard?

Icon problem

On version HA 2021.11. *, the icon pack has been updated.
Now they are not displayed on your card.
55
The buttons work, but the icon is not displayed!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.