-
-
Notifications
You must be signed in to change notification settings - Fork 47
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added functionality to open openHAB Preview on macOS based systems #14
Conversation
Hi @dennisausbremen! Thank you for your contribution.
In fact, there is a way to provide configuration points for the extension. Please take a look: https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributesconfiguration All we need to do is to add a "configuration" node within "contributes" in "configuration": {
"type": "object",
"title": "openHAB configuration",
"properties": {
"openhab.hostname": {
"type": "string",
"default": null, // or 'localhost' ?
"description": "Hostname or IP address of openHAB instance."
}
}
} And then in the code you would just use this config like this: let config = vscode.workspace.getConfiguration('openhab')
console.log(config.hostname) // localhost or openhabianpi etc. A few remarks, though:
Thanks again! |
src/extension.ts
Outdated
} | ||
|
||
const getFileName = () => { | ||
return (os === 'win32') ? absolutePath.split('\\').pop() : absolutePath.split('/').pop() |
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.
Just a thought. We could utilize Node.js path library so it does the detection for us :)
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 was late yesterday. 馃槃
Will do.
Thanks for the input! 馃帀
I think i just missed that. Great. 馃槅 馃憤 The main problem with the parsing of the correct path is, that it just works somewhat great on windows. 馃槥
|
I'm perfectly fine with this. Let's just make sure that Cheers! 馃槂 |
Updated my code to accomodate your feedback. |
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.
Awesome @dennisausbremen , thank you so much for your enhancements! 馃
* openhab.host (mandatory), default: openhabianpi | ||
* openhab.port (optional), default: 8080 | ||
|
||
These settings should work fine on Windows machines and openHAB installations using the recommended [openHABian](http://docs.openhab.org/installation/openhabian.html) setup. |
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 for openHABian recognition! :-)
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 Indeed 馃槃
@dennisausbremen your changes LGTM overall. There's one thing that's needed from you before I merge it. Can you squash your commits and change commit message to include a Signed-off-by (to certify that you wrote it or otherwise have the right to pass it on as an open-source), see http://docs.openhab.org/developers/contributing/contributing.html#sign-your-work For squashing / rebasing see: Also, if you edit your first comment with |
Added configuration for openhab.host and openhab.path Updated README.md to accomodate new configuration options (including examples) Signed-off-by: Dennis Gieseler <dennis.gieseler@me.com> (github: dennisausbremen)
@kubawolanin: Like this? 馃槃 |
perfecto! Thanks again mate! |
No problem! 馃嵏馃槑馃憤 |
Unfortunately I'm not able to test on Linux atm.
Since there seems to be no "configurability" in VSCode extensions a lot has to be hardcoded. 馃槥
Closes #15