Closed W-Geronius closed 3 years ago
I merged your PR with some modifications inspired by PR from @hkapanen. However I could not test these changes, since I don't have any RuuviTags with me at the moment so I hope it works :)
I had the chance to test the PR on a live system. Still running. No problems encountered. And it basically fulfilled my feature request (closed by myself).Thanks to @W-Geronius and @vokkim
Sorry to say, Mikko, but with the other changes the initial error was reintroduced. According to SK specs, in outside branch it must be named 'humidity' and in insidebranch it must be named 'relativeHumidity'. Now the plugin would produce 'environment.outside.relativeHumidity'.
Additionally: the new location pattern [a-zA-Z0-9]+(\.[a-zA-Z0-9])*
would allow invalid paths as well as multiple subpaths, conflicting with SK schema
And sorry for that, tried to fix it now in 1.2.3
but still coding blind. This plugin would need tests (wink), wish I had the time!
I sure can test by code inspection and with ruuvitag - from what I saw in the code, it would just be necessary to merge the new 'try - catch' thing to my PR code. I know my approach looks complicated, but it's required because of the unfortunate SK schema rules ;)
This PR proposes modifications in order to
Plugin Setup to determine SK paths:
When applying this modifications, previous setups will not be changed, but internally stripped of any included dots. These values will show up in inside path. It is strongly advised however to visit the setup page after install