Skip to content

Commit

Permalink
Update power mode selector to show mode
Browse files Browse the repository at this point in the history
  • Loading branch information
UpstreamData committed Jan 6, 2025
1 parent a2961c9 commit c685720
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 174 deletions.
6 changes: 5 additions & 1 deletion custom_components/miner/select.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""A selector for the miner's mining mode."""
from __future__ import annotations

import logging

from homeassistant.components.select import SelectEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import callback
Expand All @@ -16,6 +18,8 @@
from custom_components.miner import DOMAIN
from custom_components.miner import MinerCoordinator

_LOGGER = logging.getLogger(__name__)


async def async_setup_entry(
hass: HomeAssistant,
Expand Down Expand Up @@ -76,7 +80,7 @@ def device_info(self) -> entity.DeviceInfo:
def current_option(self) -> str | None:
"""The current option selected with the select."""
config: MinerConfig = self.coordinator.data["config"]
return str(config.mining_mode.mode)
return str(config.mining_mode.mode).title()

@property
def options(self) -> list[str]:
Expand Down
Loading

0 comments on commit c685720

Please sign in to comment.