-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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 Fixer.io #2336
Add support for Fixer.io #2336
Conversation
self.data.update() | ||
self._state = round(self.data.rate['rates'][self._target], 3) | ||
|
||
class ExchangeData(object): |
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.
- 1: E302 expected 2 blank lines, found 1
It's amazing that you can accomplish this in less than an hour and I spent days getting nowhere with it :) BTW, Fixer updates the currencies only once a day. Whereas the others (Currencylayer and Openexchangerates) update their rates hourly. It will be nice if can you take the code that I have for the other two sensors and create the components for them (I wish I knew how to get the |
It's true that fixer.io is not the best source if you want to follow the trend of exchange rates closely. |
|
||
|
||
# pylint: disable=too-few-public-methods | ||
class ExchangeRateSensor(Entity): |
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.
Shouldn't unit_of_measurement
be self._target
? That way you can get a graph
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.
Yes, it should
🐬 |
Description:
There seems to be a demand for exchange rate sensors (eg. Currencylayer and #2310). Fixer.io doesn't require an API key and allows unlimited requests (for now).
Related issue (if applicable): fixes #
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#574
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If code communicates with devices:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass