1
mirror of https://github.com/home-assistant/core synced 2024-07-18 12:02:20 +02:00

Remove friendly_name attribute from twitch sensor (#32067)

* Remove friendly_name attribute twitch sensor

* Use deepcopy to only copy the content

* Update homeassistant/components/twitch/sensor.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/twitch/sensor.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
springstan 2020-02-25 02:55:31 +01:00 committed by GitHub
parent ad102b3840
commit 88df9c8ab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ from twitch import TwitchClient
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_FRIENDLY_NAME, CONF_TOKEN
from homeassistant.const import CONF_TOKEN
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@ -96,10 +96,7 @@ class TwitchSensor(Entity):
@property
def device_state_attributes(self):
"""Return the state attributes."""
attr = {
ATTR_FRIENDLY_NAME: self._channel.display_name,
}
attr.update(self._statistics)
attr = dict(self._statistics)
if self._oauth_enabled:
attr.update(self._subscription)