mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-16 13:56:29 +00:00
frontend: apply sentence-style capitalization to headings (#2189)
- to comply with MS Style Guide on [capitalization](https://learn.microsoft.com/en-us/style-guide/capitalization)
This commit is contained in:
parent
2f2c7db974
commit
8942adbb4c
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "Frontend Architecture"
|
title: "Frontend architecture"
|
||||||
sidebar_label: "Architecture"
|
sidebar_label: "Architecture"
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ Folder: `src/dialogs`
|
|||||||
|
|
||||||
Certain information and data entry is presented to users in flows. Dialogs can be triggered on any page. The most common one is the entity more info dialog, which allows users to dig into an entity's state, history, and settings.
|
Certain information and data entry is presented to users in flows. Dialogs can be triggered on any page. The most common one is the entity more info dialog, which allows users to dig into an entity's state, history, and settings.
|
||||||
|
|
||||||
## Data Flow
|
## Data flow
|
||||||
|
|
||||||
The frontend leverages the [Websocket API](api/websocket.md) and the [Rest API](api/rest.md) to interact with Home Assistant.
|
The frontend leverages the [Websocket API](api/websocket.md) and the [Rest API](api/rest.md) to interact with Home Assistant.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "Custom Cards"
|
title: "Custom cards"
|
||||||
---
|
---
|
||||||
|
|
||||||
[Dashboards](https://www.home-assistant.io/dashboards/) are our approach to defining your user interface for Home Assistant. We offer a lot of built-in cards, but you're not just limited to the ones that we decided to include in Home Assistant. You can build and use your own!
|
[Dashboards](https://www.home-assistant.io/dashboards/) are our approach to defining your user interface for Home Assistant. We offer a lot of built-in cards, but you're not just limited to the ones that we decided to include in Home Assistant. You can build and use your own!
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "Custom Strategies"
|
title: "Custom strategies"
|
||||||
---
|
---
|
||||||
|
|
||||||
_Introduced in Home Assistant 2021.5._
|
_Introduced in Home Assistant 2021.5._
|
||||||
@ -12,7 +12,7 @@ A strategy can be applied to the whole configuration or to a specific view.
|
|||||||
|
|
||||||
Strategies are defined as a custom element in a JavaScript file, and included [via dashboard resources](./registering-resources.md). Home Assistant will call static functions on the class instead of rendering it as a custom element.
|
Strategies are defined as a custom element in a JavaScript file, and included [via dashboard resources](./registering-resources.md). Home Assistant will call static functions on the class instead of rendering it as a custom element.
|
||||||
|
|
||||||
## Dashboard Strategies
|
## Dashboard strategies
|
||||||
|
|
||||||
A dashboard strategy is responsible for generating a full dashboard configuration. This can either be from scratch, or based on an existing dashboard configuration that is passed in.
|
A dashboard strategy is responsible for generating a full dashboard configuration. This can either be from scratch, or based on an existing dashboard configuration that is passed in.
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ strategy:
|
|||||||
type: custom:my-demo
|
type: custom:my-demo
|
||||||
```
|
```
|
||||||
|
|
||||||
## View Strategies
|
## View strategies
|
||||||
|
|
||||||
A view strategy is responsible for generating the configuration of a specific dashboard view. The strategy is invoked when the user opens the specific view.
|
A view strategy is responsible for generating the configuration of a specific dashboard view. The strategy is invoked when the user opens the specific view.
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ views:
|
|||||||
type: custom:my-demo
|
type: custom:my-demo
|
||||||
```
|
```
|
||||||
|
|
||||||
## Full Example
|
## Full example
|
||||||
|
|
||||||
It's recommended for a dashboard strategy to leave as much work to be done to the view strategies. That way the dashboard will show up for the user as fast as possible. This can be done by having the dashboard generate a configuration with views that rely on its own strategy.
|
It's recommended for a dashboard strategy to leave as much work to be done to the view strategies. That way the dashboard will show up for the user as fast as possible. This can be done by having the dashboard generate a configuration with views that rely on its own strategy.
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: "Custom View Layout"
|
title: "Custom view layout"
|
||||||
---
|
---
|
||||||
|
|
||||||
By default Home Assistant will try to show the cards in a masonry layout (like Pinterest). A Custom View Layout allows developers to override this and define the layout mechanism (like a grid).
|
By default Home Assistant will try to show the cards in a masonry layout (like Pinterest). A custom view layout allows developers to override this and define the layout mechanism (like a grid).
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ A custom view can be used by adding the following to the definition of your view
|
|||||||
|
|
||||||
The default masonry view is an example of a layout element. ([source](https://github.com/home-assistant/frontend/blob/master/src/panels/lovelace/views/hui-masonry-view.ts)).
|
The default masonry view is an example of a layout element. ([source](https://github.com/home-assistant/frontend/blob/master/src/panels/lovelace/views/hui-masonry-view.ts)).
|
||||||
|
|
||||||
## Store Custom Data
|
## Store custom data
|
||||||
|
|
||||||
If your view requires data to persist at a card level, there is a `view_layout` in the card configuration that can be used to store information. Example: Key, X and Y coordinates, width and height, etc. This can be useful when you need to store the location or dimensions of a card for your view.
|
If your view requires data to persist at a card level, there is a `view_layout` in the card configuration that can be used to store information. Example: Key, X and Y coordinates, width and height, etc. This can be useful when you need to store the location or dimensions of a card for your view.
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ If your view requires data to persist at a card level, there is a `view_layout`
|
|||||||
entity: weather.my_weather
|
entity: weather.my_weather
|
||||||
```
|
```
|
||||||
|
|
||||||
## Edit, Delete, or Add a Card
|
## Edit, delete, or add a card
|
||||||
|
|
||||||
To call the core frontend dialogs to edit, delete or add a card, you can simply call these three events:
|
To call the core frontend dialogs to edit, delete or add a card, you can simply call these three events:
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "Registering Resources"
|
title: "Registering resources"
|
||||||
---
|
---
|
||||||
|
|
||||||
If you want to extend the Home Assistant interface with custom cards, strategies or views you need to load external resources.
|
If you want to extend the Home Assistant interface with custom cards, strategies or views you need to load external resources.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "External Authentication"
|
title: "External authentication"
|
||||||
---
|
---
|
||||||
|
|
||||||
By default, the frontend will take care of its own authentication tokens. If none are found, it will redirect the user to the login page and it will take care of updating the token.
|
By default, the frontend will take care of its own authentication tokens. If none are found, it will redirect the user to the login page and it will take care of updating the token.
|
||||||
@ -8,7 +8,7 @@ If you want to embed the Home Assistant frontend in an external app, you will wa
|
|||||||
|
|
||||||
To activate this API, load the frontend with `?external_auth=1` appended to the URL. If this is passed in, Home Assistant will expect either `window.externalApp` (for Android) or `window.webkit.messageHandlers` (for iOS) to be defined containing the methods described below.
|
To activate this API, load the frontend with `?external_auth=1` appended to the URL. If this is passed in, Home Assistant will expect either `window.externalApp` (for Android) or `window.webkit.messageHandlers` (for iOS) to be defined containing the methods described below.
|
||||||
|
|
||||||
## Get Access Token
|
## Get access token
|
||||||
|
|
||||||
_This API has been introduced in Home Assistant 0.78._
|
_This API has been introduced in Home Assistant 0.78._
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ window.externalAuthSetToken(false);
|
|||||||
|
|
||||||
The frontend will call this method when the page first loads and whenever it needs a valid token but the previous received token has expired.
|
The frontend will call this method when the page first loads and whenever it needs a valid token but the previous received token has expired.
|
||||||
|
|
||||||
## Revoke Token
|
## Revoke token
|
||||||
|
|
||||||
_This API has been introduced in Home Assistant 0.78._
|
_This API has been introduced in Home Assistant 0.78._
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "External Bus"
|
title: "External bus"
|
||||||
---
|
---
|
||||||
|
|
||||||
The frontend is able to set up a message bus with an external app that is embedding the Home Assistant frontend. This system is a generalization of the [external authentication](frontend/external-authentication.md), making it easier to add more commands in the future without extensive plumbing on either the app or frontend side.
|
The frontend is able to set up a message bus with an external app that is embedding the Home Assistant frontend. This system is a generalization of the [external authentication](frontend/external-authentication.md), making it easier to add more commands in the future without extensive plumbing on either the app or frontend side.
|
||||||
@ -32,7 +32,7 @@ window.externalBus(message: string)
|
|||||||
|
|
||||||
The message describes an action or a piece of information that the sender wants the receiver to do or know about. If it's an action, the sender will expect a response with the result of that action. A response to a command can either be successful or failed.
|
The message describes an action or a piece of information that the sender wants the receiver to do or know about. If it's an action, the sender will expect a response with the result of that action. A response to a command can either be successful or failed.
|
||||||
|
|
||||||
### Action and Info Message format
|
### Action and info message format
|
||||||
|
|
||||||
The format of a message that contains or provides information is the same. It contains an identifier, a type and an optional payload (depending on the type).
|
The format of a message that contains or provides information is the same. It contains an identifier, a type and an optional payload (depending on the type).
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ An example message:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Result Message Format
|
### Result message format
|
||||||
|
|
||||||
If the message was an action, the sender will expect a response with the result. The response is either success or failure.
|
If the message was an action, the sender will expect a response with the result. The response is either success or failure.
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ interface ErrorResult {
|
|||||||
|
|
||||||
## Supported messages
|
## Supported messages
|
||||||
|
|
||||||
### Get External Config
|
### Get external config
|
||||||
|
|
||||||
Available in: Home Assistant 0.92
|
Available in: Home Assistant 0.92
|
||||||
Type: `config/get`
|
Type: `config/get`
|
||||||
@ -107,7 +107,7 @@ Expected response payload:
|
|||||||
- `hasSettingsScreen` set to true if the external app will show a configuration screen when it receives the command `config_screen/show`. If so, a new option will be added to the sidebar to trigger the configuration screen.
|
- `hasSettingsScreen` set to true if the external app will show a configuration screen when it receives the command `config_screen/show`. If so, a new option will be added to the sidebar to trigger the configuration screen.
|
||||||
- `canWriteTag` set to true if the external app is able to write tags and so can support the `tag/write` command.
|
- `canWriteTag` set to true if the external app is able to write tags and so can support the `tag/write` command.
|
||||||
|
|
||||||
### Show Config Screen `config_screen/show`
|
### Show config screen `config_screen/show`
|
||||||
|
|
||||||
Available in: Home Assistant 0.92
|
Available in: Home Assistant 0.92
|
||||||
Type: `config_screen/show`
|
Type: `config_screen/show`
|
||||||
@ -116,7 +116,7 @@ Expect answer: no
|
|||||||
|
|
||||||
Show the configuration screen of the external app.
|
Show the configuration screen of the external app.
|
||||||
|
|
||||||
### Connection Status update `connection-status`
|
### Connection status update `connection-status`
|
||||||
|
|
||||||
Available in: Home Assistant 0.92
|
Available in: Home Assistant 0.92
|
||||||
Type: `connection-status`
|
Type: `connection-status`
|
||||||
@ -133,7 +133,7 @@ Payload structure:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Trigger Haptic `haptic`
|
### Trigger haptic `haptic`
|
||||||
|
|
||||||
Available in: Home Assistant 0.92
|
Available in: Home Assistant 0.92
|
||||||
Type: `haptic`
|
Type: `haptic`
|
||||||
@ -158,7 +158,7 @@ Payload structure:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Write Tag `tag/write`
|
### Write tag `tag/write`
|
||||||
|
|
||||||
Available in: Home Assistant 0.115
|
Available in: Home Assistant 0.115
|
||||||
Type: `tag/write`
|
Type: `tag/write`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user