Skip to content

Commit

Permalink
Add number entity for usage_quota option
Browse files Browse the repository at this point in the history
  • Loading branch information
ufozone committed Dec 18, 2023
1 parent 2adf086 commit fe734ba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions custom_components/unifi_voucher/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from homeassistant.core import HomeAssistant
from homeassistant.const import (
UnitOfInformation,
UnitOfTime,
)
from homeassistant.config_entries import ConfigEntry
Expand All @@ -16,6 +17,7 @@
DOMAIN,
CONF_VOUCHER_QUOTA,
CONF_VOUCHER_DURATION,
CONF_VOUCHER_USAGE_QUOTA,
DEFAULT_VOUCHER,
)
from .coordinator import UnifiVoucherCoordinator
Expand All @@ -41,6 +43,12 @@ async def async_setup_entry(
native_unit_of_measurement=UnitOfTime.HOURS,
translation_key=CONF_VOUCHER_DURATION,
),
NumberEntityDescription(
key=CONF_VOUCHER_USAGE_QUOTA,
icon="mdi:database-sync",
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
translation_key=CONF_VOUCHER_USAGE_QUOTA,
),
]

async_add_entities(
Expand Down

0 comments on commit fe734ba

Please sign in to comment.