Add method to return 'hass' object from browser console to docs (#368)

* Add method to return 'hass' object from browser console

* better grammar

* add warning about accessing hass property and update call per bram's suggestion

* Update frontend_data.md
This commit is contained in:
Raman Gupta 2020-03-20 08:52:51 -04:00 committed by GitHub
parent 38bc857dd4
commit 35224e33f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,14 @@ Whenever a state changes, a new version of the objects that changed are created.
const changed = newVal !== oldVal;
```
In order to see the data available in the `hass` object, visit your HomeAssistant frontend in your favorite browser and open the browser's developer tools. On the elements panel, select the `<home-assistant>` element, or any other element that has the `hass` property, and then run the following command in the console panel:
```js
$0.hass
```
This method of reading the `hass` object should only be used as a reference. In order to interact with `hass` in your code, make sure it is passed to your code correctly.
## Data
### `hass.states`