mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Add Netgear entity category and configuration url (#62260)
* add entity category * add configuration_url * add import
This commit is contained in:
parent
5fefb5985f
commit
c4879d71a1
@ -1,5 +1,6 @@
|
||||
"""Support for Netgear routers."""
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_HOST
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
@ -30,6 +31,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
name=router.device_name,
|
||||
model=router.model,
|
||||
sw_version=router.firmware_version,
|
||||
configuration_url=f"http://{entry.data[CONF_HOST]}/",
|
||||
)
|
||||
|
||||
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
|
||||
|
@ -7,6 +7,7 @@ from homeassistant.components.sensor import (
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import PERCENTAGE
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .router import NetgearDeviceEntity, NetgearRouter, async_setup_netgear_entry
|
||||
@ -15,25 +16,30 @@ SENSOR_TYPES = {
|
||||
"type": SensorEntityDescription(
|
||||
key="type",
|
||||
name="link type",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"link_rate": SensorEntityDescription(
|
||||
key="link_rate",
|
||||
name="link rate",
|
||||
native_unit_of_measurement="Mbps",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"signal": SensorEntityDescription(
|
||||
key="signal",
|
||||
name="signal strength",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"ssid": SensorEntityDescription(
|
||||
key="ssid",
|
||||
name="ssid",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"conn_ap_mac": SensorEntityDescription(
|
||||
key="conn_ap_mac",
|
||||
name="access point mac",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user