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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 84 additions and 27 deletions

View file

@ -4,6 +4,7 @@ import logging
from homeassistant.const import (
DEVICE_CLASS_SIGNAL_STRENGTH,
DEVICE_CLASS_TEMPERATURE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
TEMP_FAHRENHEIT,
)
from homeassistant.helpers.entity import Entity
@ -14,7 +15,11 @@ _LOGGER = logging.getLogger(__name__)
SENSORS = {
TYPE_TEMPERATURE: ["Temperature", TEMP_FAHRENHEIT, DEVICE_CLASS_TEMPERATURE],
TYPE_WIFI_STRENGTH: ["Wifi Signal", "dBm", DEVICE_CLASS_SIGNAL_STRENGTH],
TYPE_WIFI_STRENGTH: [
"Wifi Signal",
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
DEVICE_CLASS_SIGNAL_STRENGTH,
],
}