Skip to content

Commit

Permalink
✨ Move most sensors under Diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
anarion80 committed Mar 24, 2024
1 parent db11e3c commit 185fa50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion custom_components/tech/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
import logging

from homeassistant.components import binary_sensor
from homeassistant.const import CONF_PARAMS, CONF_TYPE, STATE_OFF, STATE_ON
from homeassistant.const import (
CONF_PARAMS,
CONF_TYPE,
STATE_OFF,
STATE_ON,
EntityCategory,
)

from . import TechCoordinator, assets
from .const import (
Expand Down Expand Up @@ -54,6 +60,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
class TileBinarySensor(TileEntity, binary_sensor.BinarySensorEntity):
"""Representation of a TileBinarySensor."""

_attr_entity_category = EntityCategory.DIAGNOSTIC

def get_state(self, device):
"""Get the state of the device."""

Expand Down
5 changes: 5 additions & 0 deletions custom_components/tech/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
PERCENTAGE,
STATE_OFF,
STATE_ON,
EntityCategory,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant, callback
Expand Down Expand Up @@ -592,6 +593,8 @@ def device_info(self):
class ZoneSensor(CoordinatorEntity, SensorEntity):
"""Representation of a Zone Sensor."""

_attr_entity_category = EntityCategory.DIAGNOSTIC

def __init__(
self, device: Dict, coordinator: TechCoordinator, config_entry: ConfigEntry
):
Expand Down Expand Up @@ -819,6 +822,8 @@ def update_properties(self, device):
class TileSensor(TileEntity, CoordinatorEntity):
"""Representation of a TileSensor."""

_attr_entity_category = EntityCategory.DIAGNOSTIC

def get_state(self, device):
"""Get the state of the device."""

Expand Down

0 comments on commit 185fa50

Please sign in to comment.