mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Remove incorrect device class from blebox button (#75042)
* Removed redundant attr device class from button. * Removed irrelevant test for checking buttons device_class.
This commit is contained in:
parent
dfe840c045
commit
6a37600936
@ -1,7 +1,7 @@
|
|||||||
"""BleBox button entities implementation."""
|
"""BleBox button entities implementation."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.button import ButtonDeviceClass, ButtonEntity
|
from homeassistant.components.button import ButtonEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -26,7 +26,6 @@ class BleBoxButtonEntity(BleBoxEntity, ButtonEntity):
|
|||||||
def __init__(self, feature):
|
def __init__(self, feature):
|
||||||
"""Initialize a BleBox button feature."""
|
"""Initialize a BleBox button feature."""
|
||||||
super().__init__(feature)
|
super().__init__(feature)
|
||||||
self._attr_device_class = ButtonDeviceClass.UPDATE
|
|
||||||
self._attr_icon = self.get_icon()
|
self._attr_icon = self.get_icon()
|
||||||
|
|
||||||
def get_icon(self):
|
def get_icon(self):
|
||||||
|
@ -5,7 +5,6 @@ from unittest.mock import PropertyMock
|
|||||||
import blebox_uniapi
|
import blebox_uniapi
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.button import ButtonDeviceClass
|
|
||||||
from homeassistant.const import ATTR_ICON
|
from homeassistant.const import ATTR_ICON
|
||||||
|
|
||||||
from .conftest import async_setup_entity, mock_feature
|
from .conftest import async_setup_entity, mock_feature
|
||||||
@ -50,8 +49,6 @@ async def test_tvliftbox_init(tvliftbox, hass, config, caplog):
|
|||||||
|
|
||||||
assert entry.unique_id == "BleBox-tvLiftBox-4a3fdaad90aa-open_or_stop"
|
assert entry.unique_id == "BleBox-tvLiftBox-4a3fdaad90aa-open_or_stop"
|
||||||
|
|
||||||
assert state.attributes["device_class"] == ButtonDeviceClass.UPDATE
|
|
||||||
|
|
||||||
assert state.name == "tvLiftBox-open_or_stop"
|
assert state.name == "tvLiftBox-open_or_stop"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user