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:
1 parent
0173c61fee
commit
3e23a3a860
41 files changed
+349
-223
No files matched your search
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user