Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
fix: remove diagnostic category for some entities (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasgermain authored Sep 30, 2023
1 parent 050c59b commit 369c6cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 59 deletions.
43 changes: 1 addition & 42 deletions custom_components/multimatic/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import slugify

Expand Down Expand Up @@ -116,11 +115,6 @@ def name(self) -> str:
"""Return the name of the entity."""
return self.coordinator.data.circulation.name

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC

@property
def device_class(self) -> BinarySensorDeviceClass | None:
"""Return the class of this device, from component DEVICE_CLASSES."""
Expand Down Expand Up @@ -162,11 +156,6 @@ def room(self) -> Room:
"""Return the room."""
return self.coordinator.find_component(self._room_id)

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC


class RoomDeviceEntity(MultimaticEntity, BinarySensorEntity):
"""Base class for ambisense device."""
Expand Down Expand Up @@ -255,11 +244,6 @@ def device_class(self) -> BinarySensorDeviceClass | None:
"""Return the class of this device, from component DEVICE_CLASSES."""
return BinarySensorDeviceClass.LOCK

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC


class RoomDeviceBattery(RoomDeviceEntity):
"""Represent a device battery."""
Expand Down Expand Up @@ -403,11 +387,6 @@ def device_class(self) -> BinarySensorDeviceClass | None:
"""Return the class of this device, from component DEVICE_CLASSES."""
return BinarySensorDeviceClass.CONNECTIVITY

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC


class BoilerStatus(MultimaticEntity, BinarySensorEntity):
"""Check if there is some error."""
Expand Down Expand Up @@ -476,11 +455,6 @@ def device_class(self) -> BinarySensorDeviceClass | None:
"""Return the class of this device, from component DEVICE_CLASSES."""
return BinarySensorDeviceClass.PROBLEM

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC


class MultimaticErrors(MultimaticEntity, BinarySensorEntity):
"""Check if there is any error message from system."""
Expand Down Expand Up @@ -529,11 +503,6 @@ def name(self) -> str:
"""Return the name of the entity."""
return "Multimatic Errors"

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC


class HolidayModeSensor(MultimaticEntity, BinarySensorEntity):
"""Binary sensor for holiday mode."""
Expand Down Expand Up @@ -568,11 +537,6 @@ def available(self) -> bool:
"""Return if entity is available."""
return self.coordinator.last_update_success

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC

@property
def device_class(self) -> BinarySensorDeviceClass | None:
"""Return the class of this device, from component DEVICE_CLASSES."""
Expand Down Expand Up @@ -611,11 +575,6 @@ def available(self) -> bool:
"""Return if entity is available."""
return self.coordinator.last_update_success

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC

@property
def device_class(self) -> BinarySensorDeviceClass | None:
"""Return the class of this device, from component DEVICE_CLASSES."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/multimatic/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"homekit": {},
"dependencies": [],
"codeowners": ["@thomasgermain"],
"version": "1.15.0",
"version": "1.15.1",
"iot_class": "cloud_polling",
"integration_type": "hub"
}
17 changes: 1 addition & 16 deletions custom_components/multimatic/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import UnitOfEnergy, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo, EntityCategory
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType

Expand Down Expand Up @@ -96,11 +96,6 @@ def state_class(self) -> str | None:
"""Return the state class of this entity."""
return SensorStateClass.MEASUREMENT

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC


class ReportSensor(MultimaticEntity, SensorEntity):
"""Report sensor."""
Expand Down Expand Up @@ -169,11 +164,6 @@ def name(self) -> str | None:
"""Return the name of the entity."""
return self._name

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC


class EmfReportSensor(MultimaticEntity, SensorEntity):
"""Emf Report sensor."""
Expand Down Expand Up @@ -236,8 +226,3 @@ def name(self) -> str | None:
def state_class(self) -> str:
"""Return the state class of this entity."""
return SensorStateClass.TOTAL_INCREASING

@property
def entity_category(self) -> EntityCategory | None:
"""Return the category of the entity, if any."""
return EntityCategory.DIAGNOSTIC

0 comments on commit 369c6cc

Please sign in to comment.