-
Notifications
You must be signed in to change notification settings - Fork 81
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
check for openhab environent and php support. #1290
check for openhab environent and php support. #1290
Conversation
This is a cherry-picked feature taken from a future changeset for the development branch. This is the minimum requirement to make the cometvisu work when its served by the openHAB server. The check is needed because some of the backend URLs are different in openHAB. Signed-off-by: Tobias Bräutigam <tbraeutigam@gmail.com>
const engine = cv.TemplateEngine.getInstance(); | ||
const clientBackend = engine.visu && typeof engine.visu.getBackend === 'function' ? engine.visu.getBackend() : {}; | ||
if (clientBackend.resources && clientBackend.resources.rest) { | ||
path = clientBackend.resources.rest; |
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.
Is this code path only relevant for OpenHAB?
Or could it also be used by KNX, e.g. when served by the Docker container?
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 has always been a mix-up of two different things. The URL of the CometVisus REST-API has nothing to do with the backend used for state handling. e.g. you can use openHAB as "state-backend" and still have the normal PHP-REST-API (when you use the docker container). Only if you serve the CometVisu via openHABs own webserver, you use the REST-API that the cometvisu binding provides (same features as the PHP stuff, but natively implemented in java to make it work in openhab). And for that you need a slightly different URL. And thats what this is all about. So you only need to know if the CometVisu is served via openHAB.
Now I tried a plain Could that be the cause of this message? |
You never know, but I don't think so. I see the same request here, but it gets an answer and is working just fine. As the error show this is an server error (Status 500) you will find an error in you server logs that will describe the problem. |
This is a cherry-picked feature taken from a future changeset for the development branch. This is the minimum requirement to make the cometvisu work when its served by the openHAB server. The check is needed because some of the backend URLs are different in openHAB.