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

Device config extensions support #294

Closed
sweetpi opened this issue Oct 11, 2014 · 6 comments

Comments

Projects
None yet
3 participants
@sweetpi
Copy link
Contributor

commented Oct 11, 2014

pimatic device configs now support config extensions. These are config properties that can be added to a device config like normal config properties, but the plugin author has not to implement the logic to handle them. The config extensions get handed by the framework (and frontends) itself.

Usage

For switch devices:

  • xConfirm: if set to true, then switching off or on the device from the gui must be confirmed by the user.
  • xOnLabel,xOffLabel: Let the user define custom labels for the on and off state.

Example:

{
  "id": "some-id",
  "name": "Some Name",
  "class": "SomeSwitchClass",
  ...
  "xConfirm": true,
  "xOnLabel": "1",
  "xOffLabel": "0",
  "xLink": "http://www.google.de"
}

For presence devices:

  • xPresentLabel,xAbsentLabel: Let the user define custom labels for the present and absent state.

For almost all devices:

  • xLink: Let the user define a link that is shown, if the device label is clicked in the frontend.

Example:

{
  "id": "some-id",
  "name": "Some Name",
  "class": "SomeClass",
  ...
  "xLink": "http://www.google.com"
}

For Developers:

Developers can now declare which extensions are applicable to the device: pimatic/pimatic-gpio@4e1fead

@koffienl

This comment has been minimized.

Copy link

commented Oct 11, 2014

I assume this is only for the GUI, a rule can allways set a device to on or off, regardless the confirm in the config?

@sweetpi

This comment has been minimized.

Copy link
Contributor Author

commented Oct 11, 2014

I assume this is only for the GUI, a rule can allways set a device to on or off, regardless the confirm in the config?

yes

@koffienl

This comment has been minimized.

Copy link

commented Oct 11, 2014

When adding a ShellSwitch devince through the /#edit-device page (yeah, I know .. not supported) I get this error: Invalid config of device volg-programma: #/xConfirm: Should have type boolean, was: string.
I did select (and change) the xConfirm option, so that shouldn't be the issue?

@sweetpi

This comment has been minimized.

Copy link
Contributor Author

commented Oct 11, 2014

When adding a ShellSwitch devince through the /#edit-device page (yeah, I know .. not supported) I get

Stil unsupported. The gui is simply not yet working, because it sends all config properties as strings...

@BaSoMaTiX

This comment has been minimized.

Copy link

commented Oct 14, 2014

Just tested the link feature and it works great. Thanks! :-)

@sweetpi sweetpi added the enhancement label Oct 15, 2014

@koffienl

This comment has been minimized.

Copy link

commented Oct 27, 2014

Could xConfirm also be added to a ButtonsDevice ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.