Skip to content

Commit

Permalink
Fix LINT warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus authored and Markus committed Nov 11, 2023
1 parent 3136c51 commit 5031f48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 4 additions & 3 deletions custom_components/unifi_voucher/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def get_entry_option(
self,
conf_key: str,
) -> any:
"""Get config entry option with default value as fallback."""
_default_value = DEFAULT_VOUCHER.get(conf_key, {}).get("default")
return self.config_entry.options.get(conf_key, _default_value)

Expand Down Expand Up @@ -244,13 +245,13 @@ async def async_create_voucher(
"""Create new voucher."""
try:
if number is None:
number = self.get_entry_option(CONF_VOUCHER_NUMBER)
number = int(self.get_entry_option(CONF_VOUCHER_NUMBER))

if quota is None:
quota = self.get_entry_option(CONF_VOUCHER_QUOTA)
quota = int(self.get_entry_option(CONF_VOUCHER_QUOTA))

if expire is None:
expire = self.get_entry_option(CONF_VOUCHER_EXPIRE)
expire = int(self.get_entry_option(CONF_VOUCHER_EXPIRE))

await self.client.controller.request(
UnifiVoucherCreateRequest.create(
Expand Down
4 changes: 0 additions & 4 deletions custom_components/unifi_voucher/number.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
"""UniFi Hotspot Manager number platform."""
from __future__ import annotations

from collections.abc import Callable, Coroutine
from dataclasses import dataclass

from homeassistant.core import HomeAssistant
from homeassistant.const import (
UnitOfTime,
Expand All @@ -16,7 +13,6 @@
from homeassistant.helpers.entity import Entity

from .const import (
LOGGER,
DOMAIN,
CONF_VOUCHER_QUOTA,
CONF_VOUCHER_EXPIRE,
Expand Down

0 comments on commit 5031f48

Please sign in to comment.