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

Template init parameter as POST request and more #17

Merged

Conversation

adminde
Copy link
Contributor

@adminde adminde commented May 18, 2018

Hei guys,

I finally found the time to start some PRs with long-overdue improvements/changes in my pipeline :)
This request would contain some minor fixes and features including

  • Fixing long templates being unable to be initialized due to a max-length of GET parameters, hence device/init.json?template={} is now a POST request
  • If no device/init.json?template parameter exists, the default template corresponding to the device type will be used without the prior option to deselect stuff... but this allows to just use the API request shown in device/api to test stuff
  • The delete button is no longer shown for the new device dialog
  • device/auth/... requests were moved to device_model.php with separate if ($redis) checks, as momentarily, instances without redis would automatically result in an incorrect response, where an unexisting device id was checked and a {"success":false, ...} would be returned.
  • I added an optional "prefix" parameter to templates, with the possible values "name" or "node". This results in a prefix for input and feed names, where e.g. the configured input "status" in the template for the new device "foo" would be named "foo_status". This is most probably useless for most OEM purposes but in my case inputs had to be unique, hence this small feature.
  • Syntax improvements n stuff 😄

I hope the MQTT authentication changes still work as intended, as I sadly was unable to thoroughly test them in a practical context^^
and as always, great work!

@glynhudson
Copy link
Member

Wow, that a lot for your PR. Lots of good stuff here. Sorry for the delay getting back. Development of the device module has been put on hold recently. We will be reviewing your PR soon as we plan to integrate the device module into our core system and make more use of it. Thanks a lot

@TrystanLea
Copy link
Member

Thanks a lot @adminde, this looks great and as far as I can tell from testing here works well!

@TrystanLea TrystanLea merged commit 6135a42 into emoncms:device-integration Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants