mirror of
https://github.com/home-assistant/core.git
synced 2025-11-16 06:20:07 +00:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user