Statistics sensors repect given name (#26119)

This commit is contained in:
Franck Nijhof 2019-08-22 00:54:04 +02:00 committed by Paulus Schoutsen
parent f9e518d868
commit 12f964ca57
2 changed files with 9 additions and 12 deletions

View file

@ -82,10 +82,7 @@ class StatisticsSensor(Entity):
"""Initialize the Statistics sensor."""
self._entity_id = entity_id
self.is_binary = self._entity_id.split(".")[0] == "binary_sensor"
if not self.is_binary:
self._name = "{} {}".format(name, ATTR_MEAN)
else:
self._name = "{} {}".format(name, ATTR_COUNT)
self._name = name
self._sampling_size = sampling_size
self._max_age = max_age
self._precision = precision