Add and use bunch of data size and rate related constants (#31781)

Also fix a few units to match the corresponding data.
This commit is contained in:
Ville Skyttä 2020-02-13 18:52:58 +02:00 committed by GitHub
parent 0173c61fee
commit 3e23a3a860
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 349 additions and 223 deletions

View file

@ -7,6 +7,7 @@ import os
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import DATA_MEGABYTES
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@ -63,7 +64,7 @@ class Folder(Entity):
self._number_of_files = None
self._size = None
self._name = os.path.split(os.path.split(folder_path)[0])[1]
self._unit_of_measurement = "MB"
self._unit_of_measurement = DATA_MEGABYTES
self._file_list = None
def update(self):