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:
Michał Huryn 2022-07-12 10:01:53 +02:00 committed by GitHub
parent dfe840c045
commit 6a37600936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View File

@ -1,7 +1,7 @@
"""BleBox button entities implementation."""
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.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -26,7 +26,6 @@ class BleBoxButtonEntity(BleBoxEntity, ButtonEntity):
def __init__(self, feature):
"""Initialize a BleBox button feature."""
super().__init__(feature)
self._attr_device_class = ButtonDeviceClass.UPDATE
self._attr_icon = self.get_icon()
def get_icon(self):

View File

@ -5,7 +5,6 @@ from unittest.mock import PropertyMock
import blebox_uniapi
import pytest
from homeassistant.components.button import ButtonDeviceClass
from homeassistant.const import ATTR_ICON
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 state.attributes["device_class"] == ButtonDeviceClass.UPDATE
assert state.name == "tvLiftBox-open_or_stop"