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

tweaked some English grammar #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/pages/documentation/resources/_interfaces.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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.

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_.
Copy link
Member

Choose a reason for hiding this comment

The 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:

Expand Down