Skip to content
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

[automation] Added script filename to engine, if engineIdentifier is a file #1196

Closed
wants to merge 5 commits into from
Closed

[automation] Added script filename to engine, if engineIdentifier is a file #1196

wants to merge 5 commits into from

Conversation

jpg0
Copy link
Contributor

@jpg0 jpg0 commented Nov 8, 2019

Attempt to determine the the filename from engineIdentifier and set it as the filename of the script being evaluated. If the engineIdentifier is not a file, then ignore.

Signed-off-by: Jonathan Gilbert jpg@trillica.com

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
@5iver
Copy link

5iver commented Nov 9, 2019

Could you please provide examples of how to access ScriptEngine.FILENAME in a script (Jython and JS)? This should go into the documentation, which would hopefully be included in your PR 😄. If ScriptEngine.FILENAME is not set, is the default value null? It would be great if FILENAME come through in tracebacks, instead of just <script>!

If not the script is not in a file, it would be possible to include the names of the rule and scripted condition or action, and the module's UID... like "Test rule: test scripted condition:55555eeeee".

I'm wondering if it might be useful to include this in a ScriptExtension to simplify access. I've also been thinking of other pieces of data that would be helpful in a ScriptExtension. E.g., I'd like to use the OH (or automation bundle) version in the helper libraries to only expose newer functionality to systems that support it.

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
@jpg0
Copy link
Contributor Author

jpg0 commented Nov 9, 2019

Could you please provide examples of how to access ScriptEngine.FILENAME in a script (Jython and JS)? This should go into the documentation, which would hopefully be included in your PR 😄. If ScriptEngine.FILENAME is not set, is the default value null? It would be great if FILENAME come through in tracebacks, instead of just <script>!

So I'm not exactly sure how you retrieve this from inside a script; I think that's dependent on the engine. The purpose of this is to supply it to the engine in a standard way so that the engine can use it when needed. The original (selfish) purpose of this was to get what you suggest: the filename in tracebacks. Setting it appears to acheive this.
Given this, and specifically that it's not designed to be a scriptwriter-accessible piece of information, I'm not sure that it should be part of OH docs?

If not the script is not in a file, it would be possible to include the names of the rule and scripted condition or action, and the module's UID... like "Test rule: test scripted condition:55555eeeee".

Would this be possible? I'm not sure where to get this information from at the point of script evaluation?

I'm wondering if it might be useful to include this in a ScriptExtension to simplify access. I've also been thinking of other pieces of data that would be helpful in a ScriptExtension. E.g., I'd like to use the OH (or automation bundle) version in the helper libraries to only expose newer functionality to systems that support it.

I think that it would, but my personal view is that the ScriptExtension stuff needs a bit more organisation. I feel that ideally a scriptwriter should be able to retrieve this type of information through an API which is present in the runtime, rather than requesting certain properties are injected. More like the APIs available in the JRE to inspect the environment (or the same in NodeJS or Python runtimes etc).

(A bit OT but it does clash a fair bit with the JS module system, what I'd really like to see would be something like:

const env = require('env');
let environment_description = `${env.current_file_name} running in ${env.runtime}`;

I haven't looked into how you could create an abstraction to inject unified, language-agnostic modules, but it would be very simple for JS given the module code I have.)

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
@jpg0
Copy link
Contributor Author

jpg0 commented Nov 9, 2019

Oops, I just realised that engineIdentifier was a URL not a File, so I've updated the parsing. I also added a check to only set it if it's not already set.

@cweitkamp cweitkamp requested a review from 5iver November 11, 2019 21:37
@5iver
Copy link

5iver commented Nov 11, 2019

@cweitkamp, I have my IDE fired up to work on a Jython Script Engine addon, so I'll take a deeper look at this and test it out tonight. I don't see any harm in this PR, but something in the back of my head is telling me that there might be a better place to implement this... just need to look through some code. If the tracebacks show the script name, then this PR is very helpful!

@jpg0
Copy link
Contributor Author

jpg0 commented Nov 11, 2019

My 2c on how this should be done properly...

  • The current implementation concerns itself with javax.scripting only. The 'API' to set the filename is as in the PR, so this is the right place to set it. Obviously this changes if it breaks out of javax.scripting-specific code, but I'm anticipating this is OH3 at a minimum.
  • The way that the implementation gets the filename is not optimal. The problem here is that it's never actually supplied a filename, presumably because we want to support loading scripts from places which aren't filesystems. Currently only an engineIdentifier, scriptType and an InputStream are supplied. I would suggest that this is what needs to be fixed by passing more information in to the manager, either as additional params of a script context.
    (I didn't try to do this as I wanted to keep the PR minimally intrusive!)

@5iver
Copy link

5iver commented Nov 16, 2019

My apologies... I have not had a chance to test this yet, but I plan to get to this over the weekend. However, I have put some time into the graaljs script engine addon (https://github.com/openhab/openhab2-addons/pull/6399) and have found several issue with the implementation. I doubt I will have time to completely review that one this weekend.

presumably because we want to support loading scripts from places which aren't filesystems

We do... JSON rules created through the file system and REST API (Paper UI) can have Scripted Actions and Scripted Conditions that use scripted automation. The script language to use is determined by the MimeType associated with the script type selected. IIRC, the file names and MimeTypes are assessed in ScriptFileWatcher.java, which may be able to be utilized here. But first, I want to actually see the script name being used in an exception.

@cweitkamp cweitkamp added the enhancement An enhancement or new feature of the Core label Dec 6, 2019
if ("file".equals(fileURI.getScheme())) {
File maybeScriptFile = Paths.get(fileURI).toFile();
if (maybeScriptFile.isFile()) {
engine.getContext().setAttribute(ScriptEngine.FILENAME, maybeScriptFile.getName(), ScriptContext.ENGINE_SCOPE);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file names do not have to be unique, but the paths are...

Suggested change
engine.getContext().setAttribute(ScriptEngine.FILENAME, maybeScriptFile.getName(), ScriptContext.ENGINE_SCOPE);
engine.getContext().setAttribute(ScriptEngine.FILENAME, maybeScriptFile.getPath(), ScriptContext.ENGINE_SCOPE);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does you know how this looks in a stack? Here is a sample stack trace:

org.graalvm.polyglot.PolyglotException: Item 'LivingRoomLights_Light_Real' could not be found in the item registry
        at org.eclipse.smarthome.core.internal.items.ItemRegistryImpl.getItem(ItemRegistryImpl.java:82) ~[?:?]
        at <js>.getItem(items.js:347) ~[?:?]
        at <js>.:program(color_lights.js:12) ~[?:?]
        at org.graalvm.polyglot.Context.eval(Context.java:344) ~[?:?]
        <snip>

You can see the script part of it in the middle, with each frame starting with <js>. One frame was auto-filled by the engine, because it loaded the file (items.js), the other was populated by the code in this PR because it came from a stream as it was the entry-point script loaded by OH (color_lights.js).
I am asking whether you have seen what happens if you use the full path, because for the other frames, the engine only uses the name.

Copy link

@5iver 5iver Dec 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using getPath(), before...

2019-11-24 22:42:12.190 [ERROR] [org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/opt/openhab2/conf/automation/jsr223/python/personal/test/test_script_2.py': NameError: name 'PersistenceExtensions' is not defined in <script> at line number 5

After...

2019-12-07 11:53:44.925 [ERROR] [org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/opt/openhab2/conf/automation/jsr223/python/personal/test/test_script_2.py': NameError: name 'PersistenceExtensions' is not defined in /opt/openhab2/conf/automation/jsr223/python/personal/test/test_script_2.py at line number 5

And here is a traceback before...

2019-11-20 19:54:31.471 [ERROR] [jsr223.jython] - Traceback (most recent call last):
  File "/opt/openhab2/conf/automation/lib/python/core/log.py", line 51, in wrapper
    return function(*args, **kwargs)
  File "/opt/openhab2/conf/automation/lib/python/core/rules.py", line 108, in execute
    self.callback(inputs.get('event'))
  File "<script>", line 36, in send_fire_tv_adb
NameError: global name 'Exec' is not defined

... and after...

2019-12-05 10:47:06.702 [ERROR] [jsr223.jython] - Traceback (most recent call last):
  File "/opt/openhab2/conf/automation/lib/python/core/log.py", line 51, in wrapper
    return function(*args, **kwargs)
  File "/opt/openhab2/conf/automation/lib/python/core/rules.py", line 108, in execute
    self.callback(inputs.get('event'))
  File "/opt/openhab2/conf/automation/jsr223/python/personal/misc.py", line 224, in lux_correction
    if not isinstance(event.itemState, QuantityType) or (event.itemState < QuantityType(u"1 W/m²") and items["Sun_Radiation_Diffuse"] > QuantityType(u"20 W/m²")) or (event.itemState > QuantityType(u"5 W/m²") and items["Sun_Radiation_Diffuse"] < QuantityType(u"1 W/m²")):# or event.itemState > items["Sun_Radiation_Total"] or (str(items["Mode"]) not in ["Night", "Late"] and not PersistenceExtensions.updatedSince(ir.getItem("Weather_SolarRadiation"), DateTime.now().minusHours(2))) or (event.itemState > QuantityType(u"3 W/m²") and str(items["Mode"]) in ["Night", "Late"]):
IllegalArgumentException: java.lang.IllegalArgumentException: Can not compare incompatible units.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! What is producing the Python traceback? The Python engine? If you look at the example I gave, it only includes the filename in both the JS and Java frames. Digging into where these come from, the JS comes from my module loader (the javadoc specified 'the name of the source'), and the other frames come from the Java runtime (which also only includes the filename). Additionally the script engine param Javadoc specifies that it should be 'the name of the file being executed'.

Personally I don't think that usability matters too much here; whilst it's possible to have non-unique filenames, in practice you are never working on two files with the same name. I do however see that it's going to look weird to have a mixture of paths & names in either traceback.

One option here would be to pass the engineIdentifier to the ScriptEngineFactory and let it set it, this way we can choose different options for each language, depending on whether their standard formatting uses paths or names?

(As an aside, two things that I have missed and needed to workaround in the factory is (a) never seeing the engineIdentifier and (b) not being notified about disposal of engines.)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whilst it's possible to have non-unique filenames, in practice you are never working on two files with the same name.

While not extremely common, it is very possible to have scripts of the same name in different directories.

One option here would be to pass the engineIdentifier to the ScriptEngineFactory and let it set it

I don't see this as an option, since not everyone will be using custom ScriptEngineFactories. Groovy, Jython, jRuby, Kotlin, etc. can just be dropped into the classpath.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'm not saying that it's impossible, just that in practice it's rare enough that most language implementations don't print the full path. For the languages that I know that run on the JVM, only Python & Ruby print the full path. The others (Java, Kotlin, Groovy, Scala, Javascript, plus Xtend I guess) do not, and nor do languages like C & C++. (Personally I find the full path just means you get long, confusing frames, but I accept others may not.) Additionally the docs point to using the name rather than the path.

I will switch to path if you really think it's the right way to go, but it feels like an optimisation for Jython here, rather than 'most' languages.

As for letting the ScriptEngineFactory set it; maybe we would set it if they had not? So for any language that does not set it, use the most common (name), but if it's already been set (as for example Jython is in it's own bundle, so could set it as the path), then we leave it? This means that we get the expected/idiomatic behaviour for all languages except JRuby?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally the docs point to using the name rather than the path.

Could you please provide a link? I cannot find any reference that states the path should not be used? Still, it's up to us to decide which is more functional for OH users.

I will switch to path if you really think it's the right way to go

👍 😜

but it feels like an optimisation for Jython here, rather than 'most' languages.

How so? All of the supported scripting languages can have non-unique names for scripts. I don't see anything Jython specific in a solution to provide a unique path rather than a file name to help troubleshoot an exception. Stacktraces are ugly to begin with and I don't think a full path makes it any uglier. Isn't this all irrelevant though, since stacktraces are neutered for automation?

As for letting the ScriptEngineFactory set it; maybe we would set it if they had not? So for any language that does not set it, use the most common (name), but if it's already been set (as for example Jython is in it's own bundle, so could set it as the path), then we leave it?

Jython does not set this, and there will be people who chose not to use the bundle, so it wold end up being <script>. How about defaulting to full path and having configuration options in the custom ScriptEngineFactories?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, links are:
javax.script: https://docs.oracle.com/javase/7/docs/api/javax/script/ScriptEngine.html#FILENAME
graal (examples and API calls): https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/Source.html
^ these don't specify that you shouldn't use a path, they just say that you should use a name, and that is what the example uses too.

I say it's an optimisation for Jython because when the stack trace is dumped, it will look wrong for all languages except Jython (and JRuby). For JS it will look like this:

        at <js>.myScript(/here/is/where/the/full/path/to/the/script/will/be/file.js:11) ~[?:?]
        at <js>.myFunction(file1.js:347) ~[?:?]
        at <js>.:myOtherFunction(file2.js:12) ~[?:?]
        at <js>.:myFinalFunction(file3.js:12) ~[?:?]

While you are correct that currently we have no stack traces thrown from Java code, they can be from script code, so we'll still see this.

I'm not too fussed about which way the default goes and how we switch, but I did have an idea that may solve many of these challenges:

  • Add parameter of engineIdentifier to ScriptEngineFactory.createScriptEngine(..)
  • Add parameter of ScriptExtensionAccessor (an interface extracted from ScriptExtensionManager that provides readonly access) to the same method

This way, in this case, the ScriptEngineFactories can set the filename (the generic one could choose the default). It would also mean that they get some control over how presets are accessed, so would remove the need I had for the other PR about the scriptExtension.importPreset call. Happy to submit another PR if you think it would be the way to go.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this PR for a while now and I have not seen any issues. Having the script path in exceptions is helpful. I still feel the path should be used rather than the filename, since script file names are not unique. This is true for all languages.

If I were a maintainer here, I'd hold out on merging until this was corrected.

jpg0 and others added 2 commits December 7, 2019 19:23
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>

Co-Authored-By: Scott Rushworth <openhab@5iver.com>
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
@cweitkamp cweitkamp changed the title Add script filename to engine, if engineIdentifier is a file [automation] Added script filename to engine, if engineIdentifier is a file Dec 7, 2019
@kaikreuzer
Copy link
Member

Hey guys, I didn't read through all your discussion, but I just wondered if there is some outcome like whether it is good to merge?

@jpg0
Copy link
Contributor Author

jpg0 commented May 5, 2020

@kaikreuzer the only thing that held this up was a decision related to supporting multiple scripting languages and whether to adopt a style specific to one or the other. I had originally implemented such that stack traces include the filename only (as they do in JS, and Java), yet Python includes the full file path.

Maybe this pushes at a larger approach that we decide on when supporting multiple languages where things diverge:

  • Should we always allow the supplied language to specify the approach that it wants to take? (but then do we supply a default?)
  • Should we always choose the approach we think is the best across languages? (even if it means inconsistency for some languages?)
  • Should we choose a 'preferred' language and try to keep as close to it's standards? (which in this case would be Python or Java)

TBH I don't know how much these types of decision will come up in the future. There are certainly others though, e.g.:

  • are host-provided interfaces camelCase or snake_case? (or something else)
  • how is the scripting code laid out (specifically library paths)

@5iver
Copy link

5iver commented May 5, 2020

You could read the discussion for more detail, but IMO there is a one more small change needed before this should be merged. The full path to the script should be used instead of just the name, so that users will know exactly which script caused the problem and where it is located. It is possible to have multiple scripts with the same name, so just getting the name is not very helpful, especially for a user who is not familiar with where the scripts are located.

@kaikreuzer
Copy link
Member

You could read the discussion for more detail, but IMO there is a one more small change needed before this should be merged.

I am neither a JS nor a Python expert, so if you'd ask me for an opinion and decision, I'd say do it as much Java like as possible. For the change in question, the parameter is called FILENAME, so I'd say it should indeed be just the name and not the path.

But I'd honestly prefer that the both of you agree on a solution as it is something you are the experts on and you will make use of it in your code. As long as there is no compromise that satisfies both of you, I'd think this stays unmerged, which is probably the worst option.

@kaikreuzer
Copy link
Member

I'd honestly prefer that the both of you agree on a solution

@jpg0 & @openhab-5iver Anybody willing to continue that discussion and come to a conclusion?

@jpg0
Copy link
Contributor Author

jpg0 commented Jun 18, 2020

I've been a bit busy, but just recently restarted looking at some of this. I planned to get everything in order getting the latest Graal version + Graal-provided module support against OH 3.x before looking at PRs. This is pretty much all done and working now (and much simpler than before). I'll close openhab/openhab-addons#6399 and open a number of PRs to try to get it in; this will be one of the first I'll handle.

@kaikreuzer
Copy link
Member

Sounds great @jpg0, thanks for the update!

@jpg0
Copy link
Contributor Author

jpg0 commented Sep 9, 2020

My plan for this PR:

  • Allow ScriptEngineFactorys to set the FILENAME if they like, this way they can format it to match the rest of their output
  • If it's not set, then set it to the full path of the file by default (so matches Python)

For the former, there is currently no (easy) way to get at the engineIdentifier for a ScriptEngineFactory that is being configured to process it. There are a few other things that are likely to need this too, so I will first submit a change to support this, will link that PR to this PR, then once merged will update this PR to use it.

@boc-tothefuture
Copy link

@5iver pointed out that I opened a similar PR #1885 that I created based on development of my Jruby scripting implementation.

Looking at the comments here, it seems like there is a plan to let ScriptEngineFactory implementations set the filename in a configurable manner to handle some set of use cases and then to default to providing the full path.

It appears that some work is necessary and some changes need to be figured out and discussed to support the configurability of the filename.

Can we at this point just handle the default case? Which is very simple to implement and delivers value to our users (easier error resolution), and then handle the more complex configurable case?

This PR is better than mine in that it handles it prior to eval rather than where I handle it (I wasn't sure how to get the filename prior to eval).

Can we modify this PR to to do the full path and probably not catch the base exception class (unless we have to for some reason)?

Otherwise, if we want to keep this PR open to handle the configurable case, I am happy to move the logic over to my PR to handle the default case.

@jpg0
Copy link
Contributor Author

jpg0 commented Dec 9, 2020

So I just took a look at the code and how we can make the basic (full path) work, but allow for engines to override if they like.

I recently had #1837 merged, which adds the engineIdentifier to the engine context for ScriptEngines. The challenge here is ordering; this is set post-construction so it's not easy for a script engine to override it with a custom value. Saying this, the same problem exists for the other values, so I'm currently wrapping and lazily initialising my ScriptEngines. So if we go with this, maybe we should just set it like in this PR, but do it alongside setting the other bits of context, in the createScriptEngine method rather than loadScript. It means diverging from the default is a little convoluted for other script engine factories, but possible.

Happy for either me or you to do it: I think this PR has lost it's source branch anyway, so I suspect that I'd need to open a new regardless.

@boc-tothefuture
Copy link

Let me take a shot at merging these suggested changes in my PR. Will update when I have something to be looked at.

Rosi2143 added a commit to Rosi2143/openhab-core that referenced this pull request Dec 26, 2020
* Update README (2.5.x) (openhab#1153)

Change branch name.

Signed-off-by: Yannick Schaus <github@schaus.net>

* Update items.md (openhab#1156)

* Added var and VA units to UoM (openhab#1146)

VA (Volt-Ampere - apparent power) and var (Volt-Ampere reactive) are used to measure power and energy consumption in AC circuits.


Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>

* Fix filepath to keystore (openhab#1148)

Default openHAB userdata environment variable should be `$OPENHAB_USERDATA`, not `$USER_DATA` shouldn't it? At least, this is the default on my fresh openHABian and also the most popular variant to find in the docs.

* Slight language corrections (openhab#1150)

I think it reads better this way

Signed-off-by: Richard Davies <rwdrich@gmail.com>

* additional example for non default persistence service (openhab#1152)

For me it was confusing how to pass on the serviceId into methods that already had an argument. An extra example is always good.

Signed-off-by: jaco <jaco.waes@gmail.com>

* Adding 12 new logos for OH Add-Ons page on website (openhab#1158)

Signed-off-by: bracklanna bracklanna@users.noreply.github.com

* Added missing preset variables (openhab#1104)

* Added missing preset variables

Signed-off-by: Scott Rushworth <openhab@5iver.com>

* Cleaned up blank lines, fixed table, and added file name for SimpleRule

Signed-off-by: Scott Rushworth <openhab@5iver.com>

* Fix broken link (openhab#1165)

* Added Hotlink from "label" section to "state presentation" (openhab#1167)

* Added note about broken action (openhab#1164)

* Added note about broken action

See openhab#1374

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>

* Incorporated changes from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>

* Incorporated changes from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>

* Update index.md (openhab#1170)

Link appears to be wrong and does not work when I click on it in Edge. Loads the same page again instead of loading the correct new page from the hyperlink.

https://www.openhab.org/docs/developer/guidelines.html

* Added Airthings logo (openhab#1171)

* typo in exambp (openhab#1172)

`Temperature.averageSince(now.minusMinutes(5),"influxdb")`

* file.encoding=UTF-8 (openhab#1173)

* Update demo URL and add demo.rules URL (openhab#1174)

Based on: https://community.openhab.org/t/demo-setup-missing/94850
Old Link is broken leading to 404.
The link to the demo.rules on github is an extra :)

* Replace outdated zulu.org link. (#1177)

* Replace outdated zulu.org link.

As of 3/23/2020 zulu.org has an SSL cert that expired on 9/28/2019. Changed link to azul.com/downloads, since that appears to be the new official source.

Signed-off-by: Billy Stevens <contact@wasv.me>

* Changed all http links to https for installation/index.md.

All changed links working, tested on 3/24/2020.

Signed-off-by: Billy Stevens <contact@wasv.me>

* Minor language tweak (openhab#1178)

* Ending an active scan/stopScan (openhab#1179)

Signed-off-by: Mark Theiding <mark.theiding@gmail.com>

* Add files via upload (openhab#1184)

* Update persistence.md (openhab#1185)

Clarify return objects for max/min rules extensions.

Signed-off-by: Ross Kennedy rossko@culzean.clara.co.uk

* Update things.md (openhab#1186)

Amended example code to include using label and location when defining a Thing with a bridge that is defined elsewhere.

* Correct typos (openhab#1190)

* Correct usage of its/it's

"It's" is always a contraction of "it is" or "it has".  "Its" is a
possessive.  Correct a few places where they were used backwards.

Signed-off-by: Bjorn Helgaas <bjorn@helgaas.com>

* Correct "Z-Wave" spelling

Per https://www.z-wave.com/, the canonical spelling appears to be "Z-Wave".
Most places use "Z-Wave" already; change the remaining references to match.

Signed-off-by: Bjorn Helgaas <bjorn@helgaas.com>

* Correct typos and grammatical errors

Correct some typos and grammatical errors.

Signed-off-by: Bjorn Helgaas <bjorn@helgaas.com>

* Update sitemap.md section charts (openhab#1191)

I observed that the unique first word in the labels of items charted in a group isn't causing an empty chart anymore. I'm on openHAB 2.5.1.

Signed-off-by: Juergen Baginski opus42@gmx.de

* Add image for insteon binding (openhab#1196)

Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>

* typo (openhab#1198)

Signed-off-by: Mark Theiding <mark.theiding@gmail.com>

* Installation details (openhab#1197)

Added more details around the installation and configuration process.
Fixed that engine no longer logs "Activated scripting support..."

Signed-off-by: Mark Theiding <mark.theiding@gmail.com>

* Update sitemaps.md (openhab#1202)

Added full item definition for usage of visibility. See https://community.openhab.org/t/sitemap-visibility-basic-ui/97304/9

* Updated ecobee logo (https://brand.ecobee.com/) (openhab#1203)

Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>

* tutorial: Fix description of sitemap 'type' (openhab#1204)

In the tutorial, the generic sitemap description says that ItemType has
to be the same as the type defined in default.items.
Looking at
https://www.openhab.org/docs/configuration/items.html#type and
https://www.openhab.org/docs/configuration/sitemaps.html#element-types
this is incorrect as they take different values.
The example is even mislading as `Switch` is one of the only types which
is common between items and sitemaps. Might be better to describe
`Default` instead.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>

* Added information about DateTime Group functions LATEST/EARLIEST (openhab#1206)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>

* Add section for documentation contributions (openhab#1205)

Hopefully this will lower the hurdle for people to submit documentation contributions. I know from myself that I didn't submit various documentation improvements, because I didn't know git and thought it would be a much more involved process. 
Ideally there would be a separate documentation section, but submitting this under the development contribution page for now (as per discussion with @Confectrician in openhab/openhab-docs#1179 (comment)).
Note that I am addressing the issue of DCO failures wrt specifying the full name that I ran into myself in openhab/openhab-docs#1197 (comment). I found a good discussion of the issue at dcoapp/app#43.

Signed-off-by: Mark Theiding <mark.theiding@gmail.com>

* fix typo (openhab#1209)

* add description of Ephemeris localization support (openhab#1210)

Add a new section to describe the localization support and how-to steps

Signed-off-by: Michael Roßner Schrott.Micha@web.de

* Line 115 broken link - should be: (openhab#1217)

* Line 115 broken link - should be:

({{base}}/docs/configuration/sitemaps.html#element-types)

was:
({{base}}/configuration/configuration/sitemaps.html#element-types)

* Removed diplicated docs breadcrumb

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

Co-authored-by: Jerome Luckenbach <github@luckenba.ch>

* add missing space between words (openhab#1212)

* Update configuration.md (#1215)

I'm a beginner myself. Though I liked this tutorial very much, it took me some time trying and erroring and finally reading forum posts to get behind this. I didn't even know there was something like a more modern ping. So maybe others are happy to learn this right from the beginning.

* Remove architecture from Docker tags (openhab#1220)

Docker automatically detects the architecture and downloads the appropriate image (openhab/openhab-docker#213).
BuildKit will no longer generate new tags having the architecture (openhab/openhab-docker#293).

Signed-off-by: Wouter Born <github@maindrain.net>

* slight readability improvements (openhab#1221)

* slight readability improvements

* Update introduction.md

* Update introduction.md

* minor wording update

* Update eclipse.md (openhab#1225)

Clarifying that it's no longer possible to make changes in the Core Framework for 2.5.x.

Signed-off-by: Mark Theiding <mark.theiding@gmail.com>

* [fmiweather] logo for FMI Weather binding (openhab#929)

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* Update eclipse.md (openhab#1226)

Added additional structure around install, run, debug and update steps. Provided more pointers to interactions with Eclipse, Maven and Git.

Signed-off-by: Mark Theiding <mark.theiding@gmail.com>

* Update contributing.md (openhab#1227)

Need to escape \< and \> in the sign off message format so users see them explicitly in the Contributing to the Documentation section. 

Signed-off-by: Mark Theiding <mark.theiding@gmail.com>

* Update contributing.md (openhab#1228)

Small refinement on documentation change submission flow. 

Signed-off-by: Mark Theiding <mark.theiding@gmail.com>

* Add doc folder to the binding directory structure (openhab#1230)

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

* Make Subheadings Use Proper Subheading Syntax (openhab#1234)

This way they render out as proper markdown and don't look weird on the website

Signed-off-by: Stefan Zabka <zabkaste@informatik.hu-berlin.de>

* Remove unnecessary isCancelled() from code example (openhab#1235)

Cancelling an already canceled task has no effect. IMHO this check is not necesssary and removal would simplify the code. I came to this because I saw this pattern in many bindings during reviewing.

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

* Update thing-xml.md (openhab#1236)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>

* Fix broken ESH links (openhab#1231)

Signed-off-by: Wouter Born <github@maindrain.net>

* Update logging.md (openhab#1238)

Add information on how to find out the symbolic names of the bundles

* Remove Apache Commons from Default Libraries (#1229)

See openhab/openhab-addons#7722
Signed-off-by: Fabian Wolter <git@fabian-wolter.de>

* Update introduction.md (openhab#1239)

* Update introduction.md

Signed-off-by: Markus Storm markus.storm@gmx.net

* Update introduction.md

* Revise Java recommendations (openhab#1240)

* Revise Java recommendations

* Delete pine.md

Do not recommend PINE, it's not supported any longer by openHABian.

* Removed sidebar link in config

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

Co-authored-by: Jerome Luckenbach <github@luckenba.ch>

* Update security.md (openhab#1241)

Been using FreeDNS for many years (ever since all these companies got rid of their free tiers) and never an issue!

* Fix DecimalType hex conversion example (openhab#1243)

See: openhab#1526

Signed-off-by: Wouter Born <github@maindrain.net>

* Fix typo (openhab#1244)

Signed-off-by: Wouter Born <github@maindrain.net>

* Update persistence.md (openhab#1246)

Fixes link to quartz docs page.

* Revision. (openhab#1187) (openhab#1237)

* Revision. (openhab#1187)

- Update of screenshots, removal of old screenshots
- Chapters for better formatting
- Removal of ZWave chapter (one example of adding things should be enough IMHO)
- Adding items in simple mode and in "manual" mode

Signed-off-by: Sascha Billian <sascha.billian@googlemail.com>

* Use one line per sentence
Signed-off-by: Sascha Billian <sascha.billian@googlemail.com>

Co-authored-by: Jerome Luckenbach <github@luckenba.ch>

* Add notes for configuring Synology Diskstation (openhab#1219)

* Add notes for configuring Synology Diskstation

I have a working set up for SSL enabled remote access on a Synology diskstation, taking advantage of the GUI as much as possible, to ensure automatic renewal of certs from Let's Encrypt, etc. It took me about 8 hours to suss it all out, but it could be achieved in about 30 mins if you knew exactly what to do... may not be widely useful, but since Synology is officially supported, I figured this might be a good addition.

There's also a minor error in the 'allow' masks - these should be 192.168.0.0/24 to allow access to anything in the 192.168.0.xxx range.

* Updated to use one line per sentence

Updated to use one line per sentence - sorry for the delay!

* Update security.md

* Updated for one line per sentence

Updated for one line per sentence

Signed-off-by: Andrew Mills mills@prettymachine.co.nz

* Bad subnet (openhab#1245)

Nginx warns about low address bits of `192.168.0.1/24` because they are meaningless.
The correct subnet mask should be `192.168.0.0/24`

Signed-off-by: Olivier Béraud <olivierberaud@free.fr>

* Fixed broken images. (openhab#1247)

* Fixed broken images.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

* Fix image path

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

* [documentation] clarification of representation property (openhab#1248)

* [documentation] clarification of representation property

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [documentation] typo

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [documentation] adopt suggestions of reviewers

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [documentation] commas

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [documentation] typo

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [documentation] addopted suggestions of @bobadair

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [documentation] typo

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [documentaion] example added back

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [documentaion] simplified text

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [documentation] typo

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [documentation] adopted reviewer comment

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* Add Alexa mapping along side a channel mapping (openhab#1249)

* Add Alexa mapping along side a channel mapping

It took me a while to find this https://community.openhab.org/t/tagging-devices-for-alexa-support/98155/3 on the Forum and its not clearly documented in the openHAB Amazon Alexa Smart Home Skill or here in Item Metadata.
I originally suggested this as an update to the openHAB Amazon Alexa Smart Home Skill documentaion, but it fits better here, then other integrations using metadata (e.g. HomeKit or Google Assistant) could refer to it as well.

* Update items.md

* Mention defaults for element type setpoint. (openhab#1250)

Mention defaults for min, max and step value for element type setpoint.

Signed-off-by: Thomas Weiler <toweosp@gmail.com>

* Update index.md (openhab#1251)

I thought 'workl' was probably intended to be 'work'.

* Items - Bedroom_Light written as Light_Bedroom (openhab#1252)

Fix small error which might mislead some readers.

* Added example for time-weighted averages (openhab#1253)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>

* Remove deprecated UIs, Eclipse Marketplace from sidebar

Signed-off-by: Yannick Schaus <github@schaus.net>

* Update branch name in README

Signed-off-by: Yannick Schaus <github@schaus.net>

Co-authored-by: Markus Storm <markus.storm@gmx.net>
Co-authored-by: Nagy Attila Gábor <mrbig@sneaker.hu>
Co-authored-by: Christoph Thiede <38782922+LinqLover@users.noreply.github.com>
Co-authored-by: Richard Davies <rwdrich@gmail.com>
Co-authored-by: jwaes <50528773+jwaes@users.noreply.github.com>
Co-authored-by: bracklanna <16140600+bracklanna@users.noreply.github.com>
Co-authored-by: Scott Rushworth <openhab@5iver.com>
Co-authored-by: cpmeister <mistercpp2000@gmail.com>
Co-authored-by: Ross Kennedy <rossko@culzean.clara.co.uk>
Co-authored-by: Christoph Weitkamp <github@christophweitkamp.de>
Co-authored-by: Skinah <32607303+Skinah@users.noreply.github.com>
Co-authored-by: pali <pauli.anttila@gmail.com>
Co-authored-by: ljsquare <laurens-jan@merkx-ewals.nl>
Co-authored-by: PatrikG <40170469+PatrikG8@users.noreply.github.com>
Co-authored-by: Elias H <E.Hackradt@web.de>
Co-authored-by: Billy Stevens <contact@wasv.me>
Co-authored-by: theiding <mark.theiding@gmail.com>
Co-authored-by: jadcx <60408305+jadcx@users.noreply.github.com>
Co-authored-by: Bjorn Helgaas <bjorn@helgaas.com>
Co-authored-by: Jürgen Baginski <opus42@gmx.de>
Co-authored-by: robnielsen <rob.nielsen@yahoo.com>
Co-authored-by: GumbyMan82 <40233411+GumbyMan82@users.noreply.github.com>
Co-authored-by: Christophe Fergeau <teuf@gnome.org>
Co-authored-by: Paulo "JCranky" Siqueira <paulo.siqueira@gmail.com>
Co-authored-by: Michael Rossner <Schrott.Micha@web.de>
Co-authored-by: BugSmurF <52825547+bugsmurf@users.noreply.github.com>
Co-authored-by: Jerome Luckenbach <github@luckenba.ch>
Co-authored-by: josefscript <64727123+josefscript@users.noreply.github.com>
Co-authored-by: Wouter Born <github@maindrain.net>
Co-authored-by: Sami Salonen <ssalonen@gmail.com>
Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
Co-authored-by: Stefan Zabka <zabkaste@informatik.hu-berlin.de>
Co-authored-by: TRS-80 <25938297+TRSx80@users.noreply.github.com>
Co-authored-by: sihui <10405486+sihui62@users.noreply.github.com>
Co-authored-by: Andrew Mills <amil109@users.noreply.github.com>
Co-authored-by: Olivier Béraud <olivbd@users.noreply.github.com>
Co-authored-by: Andrew Fiddian-Green <software@whitebear.ch>
Co-authored-by: LeeC77 <LeeC77@users.noreply.github.com>
Co-authored-by: Thomas Weiler <18066810+toweosp@users.noreply.github.com>
Co-authored-by: garretcook <garretcook@gmail.com>
Co-authored-by: Michael Fielding <michael.fielding@gmail.com>
@kaikreuzer kaikreuzer closed this Jan 18, 2021
@kaikreuzer kaikreuzer deleted the branch openhab:master January 18, 2021 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants