Skip to content

Commit

Permalink
Fix getting WLAN name in sensor entity
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus authored and Markus committed Dec 6, 2023
1 parent c71c309 commit c2bb127
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions custom_components/unifi_voucher/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
CONF_VOUCHER_NUMBER = "voucher_number"
CONF_VOUCHER_QUOTA = "voucher_quota"
CONF_VOUCHER_EXPIRE = "voucher_expire"
CONF_VOUCHER_BYTE_QUOTA = "byte_quota"
CONF_VOUCHER_UP_BANDWIDTH = "up_bandwidth"
CONF_VOUCHER_DOWN_BANDWIDTH = "down_bandwidth"
CONF_VOUCHER_BYTE_QUOTA = "voucher_byte_quota"
CONF_VOUCHER_UP_BANDWIDTH = "voucher_up_bandwidth"
CONF_VOUCHER_DOWN_BANDWIDTH = "voucher_down_bandwidth"

ATTR_EXTRA_STATE_ATTRIBUTES = "extra_state_attributes"
ATTR_LAST_PULL = "last_pull"
Expand Down
3 changes: 2 additions & 1 deletion custom_components/unifi_voucher/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from .const import (
DOMAIN,
CONF_WLAN_NAME,
ATTR_VOUCHER,
)
from .coordinator import UnifiVoucherCoordinator
Expand Down Expand Up @@ -78,7 +79,7 @@ def _update_extra_state_attributes(self) -> None:
return None

_x = {
"wlan_name": self.coordinator.get_wlan_name(),
CONF_WLAN_NAME: self.coordinator.get_wlan_name(),
"quota": voucher.get("quota"),
"used": voucher.get("used"),
"duration": str(voucher.get("duration")), # TODO: Localized string
Expand Down

0 comments on commit c2bb127

Please sign in to comment.