Add missing unit for signal strength (#40436)

* Added missing unit for signal strength

* Added one more unit

* Replaced string with variable

* Fixed wrong import

* Fix import

* Replaced string with variable

* Fixed wrong import

* Apply suggestions from code review

* Black

* Again a fix :-(

* iSort

* iSort after merge

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
This commit is contained in:
Simone Chemelli
2020-10-01 16:14:29 +02:00
committed by GitHub
parent 480066ba63
commit 7554c8d6c5
15 changed files with 84 additions and 27 deletions

View File

@@ -3,7 +3,7 @@ import logging
import gammu # pylint: disable=import-error, no-member
from homeassistant.const import DEVICE_CLASS_SIGNAL_STRENGTH
from homeassistant.const import DEVICE_CLASS_SIGNAL_STRENGTH, SIGNAL_STRENGTH_DECIBELS
from homeassistant.helpers.entity import Entity
from .const import DOMAIN, SMS_GATEWAY
@@ -50,7 +50,7 @@ class GSMSignalSensor(Entity):
@property
def unit_of_measurement(self):
"""Return the unit the value is expressed in."""
return "dB"
return SIGNAL_STRENGTH_DECIBELS
@property
def device_class(self):