Adjust device tracker documentation (#2335)

* Adjust device tracker documentation

* Adjust defaults

* Add link

* Simplify text

* Rename
This commit is contained in:
epenet 2024-09-25 15:13:46 +02:00 committed by GitHub
parent f94f04a562
commit a52c2ab912
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 24 deletions

View File

@ -21,3 +21,5 @@ The following shorthand attributes have also been added:
- `ScannerEntity._attr_ip_address` - `ScannerEntity._attr_ip_address`
- `ScannerEntity._attr_mac_address` - `ScannerEntity._attr_mac_address`
- `ScannerEntity._attr_source_type` (defaults to `SourceType.ROUTER`) - `ScannerEntity._attr_source_type` (defaults to `SourceType.ROUTER`)
More details can be found in the [device-tracker documentation](/docs/core/entity/device-tracker).

View File

@ -17,18 +17,14 @@ Derive a platform entity from [`homeassistant.components.device_tracker.config_e
Properties should always only return information from memory and not do I/O (like network requests). Implement `update()` or `async_update()` to fetch data. Properties should always only return information from memory and not do I/O (like network requests). Implement `update()` or `async_update()` to fetch data.
::: :::
:::caution | Name | Type | Default | Description |
ScannerEntity does not support attribute shorthand for [property implementation](../entity.md#entity-class-or-instance-attributes) | ------------- | ---------------------------- | ------------------- | ----------------------------------- |
::: | battery_level | <code>int &#124; None</code> | `None` | The battery level of the device. |
| hostname | <code>str &#124; None</code> | `None` | The hostname of the device. |
| Name | Type | Default | Description | | ip_address | <code>str &#124; None</code> | `None` | The IP address of the device. |
| ------------- | ---------------------------- | ------------ | ----------------------------------------------------- | | is_connected | `bool` | **Required** | The connection state of the device. |
| battery_level | <code>int &#124; None</code> | `None` | The battery level of the device. | | mac_address | <code>str &#124; None</code> | `None` | The MAC address of the device. |
| hostname | <code>str &#124; None</code> | `None` | The hostname of the device. | | source_type | `SourceType` | `SourceType.ROUTER` | The source type of the device. |
| ip_address | <code>str &#124; None</code> | `None` | The IP address of the device. |
| is_connected | `bool` | **Required** | The connection state of the device. |
| mac_address | <code>str &#124; None</code> | `None` | The MAC address of the device. |
| source_type | `SourceType` | **Required** | The source type, eg `gps` or `router`, of the device. |
### DHCP discovery ### DHCP discovery
@ -48,15 +44,11 @@ Derive a platform entity from [`homeassistant.components.device_tracker.config_e
Properties should always only return information from memory and not do I/O (like network requests). Implement `update()` or `async_update()` to fetch data. Properties should always only return information from memory and not do I/O (like network requests). Implement `update()` or `async_update()` to fetch data.
::: :::
:::caution | Name | Type | Default | Description |
TrackerEntity does not support attribute shorthand for [property implementation](../entity.md#entity-class-or-instance-attributes) | ----------------- | ------------------------------ | ---------------- | ---------------------------------------- |
::: | battery_level | <code>int &#124; None</code> | `None` | The battery level of the device. |
| latitude | <code>float &#124; None</code> | `None` | The latitude coordinate of the device. |
| Name | Type | Default | Description | | location_accuracy | `int` | `0` | The location accuracy (m) of the device. |
| ----------------- | ------------------------------ | ------------ | ----------------------------------------------------- | | location_name | <code>str &#124; None</code> | `None` | The location name of the device. |
| battery_level | <code>int &#124; None</code> | `None` | The battery level of the device. | | longitude | <code>float &#124; None</code> | `None` | The longitude coordinate of the device. |
| latitude | <code>float &#124; None</code> | `None` | The latitude coordinate of the device. | | source_type | SourceType | `SourceType.GPS` | The source type of the device. |
| location_accuracy | `int` | `0` | The location accuracy (m) of the device. |
| location_name | <code>str &#124; None</code> | `None` | The location name of the device. |
| longitude | <code>float &#124; None</code> | `None` | The longitude coordinate of the device. |
| source_type | SourceType | **Required** | The source type, eg `gps` or `router`, of the device. |