-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[freecurrency] Initial contribution #16194
Conversation
Signed-off-by: Jan N. Klug <github@klug.nrw>
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/freecurrency-4-2-0-0-4-2-999/152632/1 |
...eecurrency/src/main/java/org/openhab/binding/freecurrency/internal/ExchangeRateListener.java
Outdated
Show resolved
Hide resolved
...eecurrency/src/main/java/org/openhab/binding/freecurrency/internal/FreecurrencyProvider.java
Outdated
Show resolved
Hide resolved
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> | ||
|
||
<thing-type id="info" extensible="exchange-rate"> |
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.
info
is a bit too generic and may not age well if the API starts providing more info. So perhaps it can be more specific?
I see the API differentiates between latest and historical exchange rates so maybe that can be reflected in the name?
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.
In general I agree. But unfortunately I'm out of ideas what would be a better naming.
bundles/org.openhab.binding.freecurrency/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
@J-N-K - I wanted to give this a test run, but failed so far by just providing a JAR:
Is there anything special that needs to be done? |
...eecurrency/src/main/java/org/openhab/binding/freecurrency/internal/FreecurrencyProvider.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jan N. Klug <github@klug.nrw>
Did you configure the API key? If not, then the |
I totally missed that this has to be configured at binding level. 😳 I did wonder where to put it. 😄 Thanks, now it works much better. |
@J-N-K - I ran into a situation where USD became quite sticky for an item without unit metadata and after having configured DKK as base currency. Updating to "1 DKK/kWh" or "1 EUR/kWh" resulted in "1 USD/kWh". After |
@J-N-K - I finally found time to run more tests, and so far I was not able to reproduce this issue. So this should not block the PR (FYI @wborn). I will naturally be testing this some more with Energi Data Service binding, and if I run into any issues later, I will isolate and report them. Thanks for this new feature! One question: Is it possible for a binding for detect changes in country or currency provider, so that channels can be updated automatically in these cases? |
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.
Thank you for the new binding!
Signed-off-by: Jan N. Klug <github@klug.nrw> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
Signed-off-by: Jan N. Klug <github@klug.nrw> Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Signed-off-by: Jan N. Klug <github@klug.nrw>
This is the first "real"
CurrencyProvider
that makes full use of the UoM currency capability introduced in openHAB 4.1. By getting a free API key 33 common currencies can be automatically converted.