module documentation
Functionality for communicating the required user interface for a thing.
| Class | |
The data required for creating an accordion in the UI. |
| Class | |
The data required for creating an actionButton in Vue. |
| Class | |
The data required for creating a block text. |
| Class | |
The data required for creating <div> in the UI. |
| Class | |
The data required for header. |
| Class | |
The data required for creating an actionButton in Vue. |
| Class | |
An HTMLParser that only allows a very limited subset of HTML. |
| Class | |
The data required for creating a block text. |
| Class | |
A list of user interface elements. |
| Function | action |
Create a ActionButton data for the specified Thing Action. |
| Function | property |
Create an PropertyControl data for the specified Thing Property. |
| Function | sanitise |
Santitise HTML to only have a small list of allowed tags. |
| Function | sanitize |
Santitise any url only allowing http and https without queries. |
| Function | strip |
Remove unprintable characters. |
| Constant | ALLOWED |
Undocumented |
| Constant | ALLOWED |
Undocumented |
| Constant | UI |
Undocumented |
| Variable | |
Undocumented |
| Variable | |
Undocumented |
Create a ActionButton data for the specified Thing Action.
| Parameters | |
thing:lt.Thing | The instance of the thing that has the action. |
actionstr | The name of the action to create a button for. |
**kwargs:Any | Any attribute of ActionButton except for thing or action. |
| Returns | |
ActionButton | An ActionButton (Pydantic Model) object with all the information the webapp needs to create the action button. |
def property_control_for(thing:
lt.Thing, property_name: str, **kwargs: Any) -> PropertyControl:
(source)
¶
Create an PropertyControl data for the specified Thing Property.
| Parameters | |
thing:lt.Thing | The instance of the thing that has the property to be controlled. |
propertystr | The name of the property to create a control for. |
**kwargs:Any | Any attribute of PropertyControl except for thing or
property_name. If label is not set here it will be the property name. |
| Returns | |
PropertyControl | Undocumented |
Santitise HTML to only have a small list of allowed tags.
Tags allowed without attrs: <i>, <b>,
Tags allowed with attrs: <a> is allowed with href only. This automatically appends target="_blank" rel="noopener noreferrer" so the link opens externally.
Self closing tags allowed <br>.
| Parameters | |
html:str | The input HTML. |
| Returns | |
str | The sanitised HTML. |
Undocumented
| Value |
|