-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Fix geizhals price parsing #15990
Fix geizhals price parsing #15990
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.
The GeizParser
class should be broken out into standalone library published on pypi.
raw = soup.find_all('span', attrs={'itemprop': 'name'}) | ||
self.device_name = raw[1].string | ||
# Parse name | ||
raw = soup.find('h1', attrs={'class': 'gh-headline'}) |
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.
This should be extracted from Home Assistant and into a separate Python library. We will not be able to accept any changes to this platform until this is fixed.
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.
Thanks for your comments @MartinHjelmare and @balloob ! I will create a separate library for that.
I found a bug in the geizhals Library. Please do not merge it yet! |
Before we merge we should also add a paragraph in the PR description about the breaking change, since config options changed. |
The Geizhals library was fixed in JulianKahnert/geizhals@5401a94 and the HA component was fixed in b949fc5. @MartinHjelmare, I added a description of the breaking change in the PR description. |
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.
We should initialize self.device
in init.
Thanks @MartinHjelmare for your reply. You are absolutly right! I added this in 828d556 |
Hey @MartinHjelmare , can you merge this? |
There seems to be a problem installing the geizhals library. The travis job failed: It looks like the package is imported in |
self.data = GeizParser(product_id, domain, regex) | ||
self._state = None | ||
self.product_id = product_id | ||
self.device = Device() |
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 use another attribute name. Entity device
is a property now after a recent PR.
You still have an installation issue with your lib. You cannot import your own lib inside |
Hi there, I'm sorry for wasting your time! d20403d should fix the problem. |
|
||
add_entities([Geizwatch(name, description, product_id, domain, regex)], | ||
True) | ||
add_devices([Geizwatch(name, description, product_id, domain)], |
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.
undefined name 'add_devices'
* fix geizhals price parsing * Fix lint issue * switch to the geizhals pypi package * throttle updates * update geizhals version * initialize empty device * minor changes to trigger another TravisCI test * device => _device * bump geizhals version
* fix geizhals price parsing * Fix lint issue * switch to the geizhals pypi package * throttle updates * update geizhals version * initialize empty device * minor changes to trigger another TravisCI test * device => _device * bump geizhals version
Description:
BREAKING CHANGE: The configuration changes from
to:
Possible
locale
values are:AT
,EU
,DE
,UK
orPL
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#6026
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:
REQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.