Add device class to proxmoxve binary sensor (#73465)
* add device class property to binary sensor * add newline
This commit is contained in:
parent
16dd70ba99
commit
a77ea1c390
1 changed files with 7 additions and 2 deletions
|
@ -1,7 +1,10 @@
|
|||
"""Binary sensor to read Proxmox VE data."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.binary_sensor import BinarySensorEntity
|
||||
from homeassistant.components.binary_sensor import (
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
@ -66,7 +69,7 @@ def create_binary_sensor(coordinator, host_name, node_name, vm_id, name):
|
|||
return ProxmoxBinarySensor(
|
||||
coordinator=coordinator,
|
||||
unique_id=f"proxmox_{node_name}_{vm_id}_running",
|
||||
name=f"{node_name}_{name}_running",
|
||||
name=f"{node_name}_{name}",
|
||||
icon="",
|
||||
host_name=host_name,
|
||||
node_name=node_name,
|
||||
|
@ -77,6 +80,8 @@ def create_binary_sensor(coordinator, host_name, node_name, vm_id, name):
|
|||
class ProxmoxBinarySensor(ProxmoxEntity, BinarySensorEntity):
|
||||
"""A binary sensor for reading Proxmox VE data."""
|
||||
|
||||
_attr_device_class = BinarySensorDeviceClass.RUNNING
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
coordinator: DataUpdateCoordinator,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue