vokkim / signalk-ruuvitag-plugin

Signal K plugin to provide RuuviTag data
MIT License
4 stars 8 forks source link

add flexibility to environment inside namings & fix humidity issue #15

Closed W-Geronius closed 3 years ago

W-Geronius commented 3 years ago

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

pluginConfig
vokkim commented 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 :)

ghost commented 3 years ago

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

W-Geronius commented 3 years ago

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

vokkim commented 3 years ago

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!

W-Geronius commented 3 years ago

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 ;)