-
Notifications
You must be signed in to change notification settings - Fork 5
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
tweaked some English grammar #166
Open
wayneoutthere
wants to merge
1
commit into
nymea:master
Choose a base branch
from
wayneoutthere:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,23 +4,23 @@ title: Interfaces | |
--- | ||
|
||
The main purpose of interfaces is to provide for a better user experience. Using interfaces, a plugin developer can suggest | ||
the ui to be used for this [ThingClass](/documentation/developers/integrations/thing-class#interfaces). For example, having a plugin that can control a dimmable light would likely have a | ||
state named "powered" of type boolean and one named "brightness" of type int, ranging from 0 to 100%. Having just this | ||
information, the ui would create a generic switch component to flip the bool state and a generic slider component to | ||
that the UI (User Interface) be used for this [ThingClass](/documentation/developers/integrations/thing-class#interfaces). For example, having a plugin that can control a dimmable light would likely have a | ||
state named "powered" of type _boolean_ and one named "brightness" of type _int_, ranging from 0 to 100%. Having just this | ||
information, the UI would create a generic switch component to flip the bool state and a generic slider component to | ||
allow adjusting the brightness because it can't know what the actual switch or slider do. For a better user experience though, | ||
the plugin developer could just add the interface "dimmedlight" to this deviceclass and this way tell the ui that this actually | ||
the plugin developer could just add the interface "dimmedlight" to this deviceclass and this way tell the UI that this actually | ||
is a dimmed light. The ui can use this information to paint a pretty brightness slider, and implicitly flip the power switch off | ||
when the brightness slider is moved to the lower end. | ||
when the brightness slider is moved to the lowermost position. | ||
|
||
Another purpose of interfaces is to help the ui grouping and managing things. For example the gateway interface does | ||
not require to implement any properties, however, it tells the ui that this is a gateway and thus not relevant to show to the | ||
user in the main control entity. Instead, gateways might be listed in the configuration section of the client application. | ||
Another purpose of interfaces is to help the UI with the task of grouping and managing things. For example the gateway interface does | ||
not require implementing any properties, however, it tells the UI that this is a gateway and thus making it no longer relevant to display to the | ||
user in the main control entity. Instead, gateways might be more appropriately listed in the configuration section of the client application. | ||
|
||
In general it is a good idea to follow as many interfaces as precicely as possible in order to provide for the best user experience. | ||
In general it is a good idea to follow as many interfaces as precisely as possible in order to provide for the best user experience. | ||
|
||
A interface can extend another interface. For example, the light interface only requires one state called powered of type bool. | ||
An interface can extend another interface. For example, the light interface only requires one state called _powered off type bool_. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the light interface requires one state. The states name is "power" and the states type is "bool". So it seems the change from "of" to "off" as well as making the whole thing italic (with the underscores) wasn't right. |
||
A dimmablelight extends this type and adds a brightness property to it. This means, if a ThingClass implements dimmablelight, | ||
it also needs to cater for the light interface's states. | ||
it also needs to cater to light interface's states. | ||
|
||
This is the list of interfaces available in nymea: | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a native english speaker, but this doesn't sound right to me.
So the way it works is that if a plugin developer for example specifies the "light" interface, nymea:app would pick the UI for lights, if a plugin developer specifies the thermostat interface, nymea:app would pick the thermostat UI for the device.