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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add enhancements to qBittorrent sensor #42837
Add enhancements to qBittorrent sensor #42837
Conversation
It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
download = data["server_state"]["dl_info_speed"] | ||
upload = data["server_state"]["up_info_speed"] | ||
|
||
if self.type == SENSOR_TYPE_CURRENT_STATUS: | ||
if upload > 0 and download > 0: | ||
self._state = "up_down" | ||
self.attrs = attributes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just move this line out side of these if
statements and just do it at the end once?
vol.Optional(CONF_MONITORED_CONDITIONS, default=DEFAULT_CONDITIONS): vol.All( | ||
cv.ensure_list, [vol.In(SENSOR_TYPES)] | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this goes against ADR-0003:
We don't merge PRs with data selectors. We remove existing unneeded selectors until Home Assistant 1.0. We focus on a good view/frontend to select and group available data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah OK I hadn't seen that, I saw here about the use of MONITORED_CONDITIONS and assumed it was OK as didn't see any mention there of any issues regarding using.
Can you make any suggestions as to what to change? Sorry if it's a basic question, this is already way over my head!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, monitored conditions is still used in some integrations. Ideally you would add a config flow so users can set it up via the frontend and do not have to alter their YAML. With a config flow a user can also easily disable sensors that they do not want to show on the frontend.
However, in this case I think it would be okay to just remove the monitored conditions and just set up all of them automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi springstan, I've added everythingsmarthomes to my PR and extended the qbittorrent integration with flow and added some services #43661
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope this helps 鉁岋笍
I have updated the qbittorent component with some goodies to flow, but i'm not getting my unittest to work. Anybody some advise? |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Proposed change
Added enhancements to the qBittorrent sensor which gives the ability to the value of each type of torrent into a sensor (total_torrents, active_torrents, inactive_torrents, seeding_torrents, paused_torrents, downloading_torrents, resumed_torrents, upload_speed, download_speed, current_status) and for each sensor it will also provide the list of each torrent in the attribute, and report the progress.
Type of change
Example entry for
configuration.yaml
:Additional information
There should be no breaking changes if "monitored_conditions" variable is not specified in the config, it will default to the way qBittorrent is setup now only monitoring the current 3 values - "Current status", "Download Speed" and "Upload Speed"
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: