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:
parent
0173c61fee
commit
3e23a3a860
41 changed files with 349 additions and 223 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue