-
-
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
[mqtt] HA: add transformation to incoming topics, where needed #4990
Conversation
channels.put(sensorChannelID, | ||
new CChannel(this, sensorChannelID, new OnOffValue(config.payload_on, config.payload_off), | ||
config.state_topic, null, config.name, config.unit_of_measurement, channelStateUpdateListener)); | ||
CChannel sensorChannel = new CChannel(this, sensorChannelID, |
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.
Note to myself: Use a channel builder pattern
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 thought about this also.
One of my next request would add specialiezed constructors for read only/write only channels.
But I will thing this through again.
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.
LGTM
If you are ready, can you remove the [WIP] for others to perform a review? Oh, and Travis fails atm |
20b77be
to
0e78aae
Compare
I have not actually run the code in openhab and test it in the gui. That is why I put the wip there in the first place. |
Could you, if possible, not force push, please. As a reviewer you never know what has changed from the last review otherwise. We can at the end merge join all commits. A UI test can be fully replaced by an equivalent integration test. I do even prefer that. @wborn had success building the recent state, including UIs, if I've read him correctly in the forum |
In the latest snapshots builds (1534,1535) the UIs are working again. They also worked while launching the runtime in my Eclipse today. You might need to build/import the openhab-webui projects for that locally. |
23bb3fc
to
e645ba4
Compare
@jochen314 Can you notify me when we start to tackle this pr? Thanks. |
e932486
to
fea4a42
Compare
I think, this is ready now. |
* "{name:'Name',state_topic:'homeassistant/switch/0/object/state',command_topic:'homeassistant/switch/0/object/set'". | ||
* @param thingUID The Thing UID that this component will belong to. | ||
* @param haID The location of this component. The HomeAssistant ID contains the object-id, node-id and | ||
* component-id. |
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.
Not a problem for me, but for others probably. Go to eclipse window->preferences->Java->code style->formatter and make sure that "ESH" is the active profile. Click apply, even if it is. Then go back to this file and let it be reformatted again.
Some unrelated problems in travis:
There was a xtext update in openhab-distro afaik, not sure. I'll retrigger in a day. |
Signed-off-by: Jochen Klein <git@jochen.susca.de>
Signed-off-by: Jochen Klein <git@jochen.susca.de>
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.
@openhab/2-x-add-ons-maintainers Can someone have a second look? Before migrating mqtt, all PRs need to be in. Thanks.
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.
One minor comment, thanks!
@@ -41,6 +42,7 @@ | |||
@NonNullByDefault | |||
public abstract class AbstractComponent<C extends BaseChannelConfiguration> { | |||
// Component location fields | |||
private ComponentConfiguration componentConfiguration; |
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.
Any reason why its not final?
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.
Dis you also see this 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.
Can you merge this PR nevertheless please? There are 1-5 more PRs to come and this code will be touched again anyhow.
The initial 3000 LOC PR was presented a month ago now and allows us to be almost 100% MQTT HA compliant and I asked Jochen to split it up into smaller pieces, easier to review for me.
And he did and his PRs are of really good quality.
There will always be the one small imperfection somewhere, but I will make sure that it is always functional correct and resource efficient.
Please let me do my job as mqtt maintainer and decide when to merge a PR, as I know the greater plan for this module. (It's not actually a critic towards you Martin, but the general process that I observe here, where contributors loose interest, because the patch flow is slowed down for nitpick reasons)
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.
@martinvw Yes, I saw it, but I could not fix it while at work.
Not special reason, just a late addition and I forgot to make it final.
I have no problem to change it ;-)
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.
Given you responded on the other one I just wanted to make sure that we could wrap up quick I did not realize more would be commng soon
...rg/openhab/binding/mqtt/generic/internal/convention/homeassistant/ComponentBinarySensor.java
Show resolved
Hide resolved
Signed-off-by: Jochen Klein <git@jochen.susca.de>
…ab#4990) Signed-off-by: Jochen Klein <git@jochen.susca.de> Signed-off-by: Pshatsillo <pshatsillo@gmail.com>
…ab#4990) Signed-off-by: Jochen Klein <git@jochen.susca.de> Signed-off-by: Maximilian Hess <mail@ne0h.de>
This change adds a transformation from a value_template to an incoming message, where needed.
As I do not have a working PaperUI right now, I could not fully test this step including the front-end...