Benadryl Social Pollen Count Sensor#24403
Closed
timmo001 wants to merge 2 commits into
Closed
Conversation
2 tasks
9 tasks
OttoWinter
reviewed
Jun 8, 2019
| if name is not None: | ||
| self.name = name | ||
| else: | ||
| self.name = DEFAULT_NAME |
Member
There was a problem hiding this comment.
Why pipe the name to PollenData and not to the entity? That way you wouldn't have to fetch it from PollenData each time you call update (which is kinda ugly)
OttoWinter
reviewed
Jun 8, 2019
| def update(self): | ||
| """Update Pollen Sensor.""" | ||
| try: | ||
| response = requests.get(self._url) |
Member
There was a problem hiding this comment.
We generally don't want to use requests anymore (#23685) - Could you try converting this to aiohttp (API is mostly the same, and there are plenty of examples in this repo)
Contributor
|
I have a few concerns regarding this one:
My feeling is that this would be better served by a REST sensor, and not accepting this PR. |
Member
Author
|
This is essentially an over-engineered rest sensor. Closing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Adds a new sensor platform for the pollen count.
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#9583
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest.requirements_all.txtby runningpython3 -m script.gen_requirements_all..coveragerc.