-
-
Notifications
You must be signed in to change notification settings - Fork 35k
Add support for total YouTube views #123144
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
Add support for total YouTube views #123144
Conversation
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.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Hey there @joostlek, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
native_unit_of_measurement="views", | ||
available_fn=lambda _: True, | ||
value_fn=lambda channel: channel[ATTR_TOTAL_VIEWS], | ||
entity_picture_fn=lambda channel: channel[ATTR_ICON], |
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.
Should we just do an icon here instead of the channel icon? I think it can look strange if you add more sensors that they all have the same picture.
Wdyt?
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.
That's true, although it doesn't bother me. Not sure if there is an appropriate icon for both of them.
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.
I think subscribers is fine as is, but let's add one for the views, not sure if there is a viable icon for that. Please use the icon translations to add one
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.
I'm wondering, what makes the views
any different from the subscribers
?
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.
Tests are failing. Can you delete the snapshots folder and run python3 -m script.translations develop --all
and pytest ./tests/components/youtube --snapshot-update
?
Done! |
And push it? |
Yes, the push got rejected because I had to rebase. All good now! |
* Add support for retrieving the total views of a channel. * Add missing tests * Re-order imports * Another run on code format * Add missing translation * Update YouTube test snapshots
Breaking change
Proposed change
Add support for retrieving the total view count of each channel that has been added.
Type of change
Additional information
Checklist
ruff format 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
.To help with the load of incoming pull requests: