Skip to content

Commit

Permalink
Run ruff and update pyasic.
Browse files Browse the repository at this point in the history
  • Loading branch information
b-rowan committed Jan 23, 2024
1 parent 2b76d7f commit 90785ad
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 30 deletions.
33 changes: 14 additions & 19 deletions custom_components/miner/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
"""Config flow for Miner."""
import logging
from typing import Optional

import pyasic
import voluptuous as vol
from homeassistant import config_entries, exceptions
from homeassistant.helpers.selector import (
TextSelector,
TextSelectorConfig,
TextSelectorType,
)

from .const import (
CONF_IP,
CONF_RPC_PASSWORD,
CONF_SSH_PASSWORD,
CONF_SSH_USERNAME,
CONF_TITLE,
CONF_WEB_PASSWORD,
CONF_WEB_USERNAME,
DOMAIN,
)
from homeassistant import config_entries
from homeassistant.helpers.selector import TextSelector
from homeassistant.helpers.selector import TextSelectorConfig
from homeassistant.helpers.selector import TextSelectorType

from .const import CONF_IP
from .const import CONF_RPC_PASSWORD
from .const import CONF_SSH_PASSWORD
from .const import CONF_SSH_USERNAME
from .const import CONF_TITLE
from .const import CONF_WEB_PASSWORD
from .const import CONF_WEB_USERNAME
from .const import DOMAIN

_LOGGER = logging.getLogger(__name__)

Expand All @@ -36,7 +31,7 @@

async def validate_ip_input(
data: dict[str, str]
) -> tuple[dict[str, str], Optional[pyasic.AnyMiner]]:
) -> tuple[dict[str, str], pyasic.AnyMiner | None]:
"""Validate the user input allows us to connect."""
miner_ip = data.get(CONF_IP)

Expand Down
4 changes: 2 additions & 2 deletions custom_components/miner/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"homekit": {},
"iot_class": "local_polling",
"issue_tracker": "https://github.com/Schnitzel/hass-miner/issues",
"requirements": ["pyasic==0.48.4"],
"requirements": ["pyasic==0.48.5"],
"ssdp": [],
"version": "1.1.1b3",
"version": "1.1.1b4",
"zeroconf": []
}
18 changes: 10 additions & 8 deletions custom_components/miner/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@
from collections.abc import Callable
from dataclasses import dataclass

from homeassistant.components.sensor import (
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.components.sensor import SensorEntity
from homeassistant.components.sensor import SensorEntityDescription
from homeassistant.components.sensor import SensorStateClass
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import REVOLUTIONS_PER_MINUTE, UnitOfPower, UnitOfTemperature
from homeassistant.core import HomeAssistant, callback
from homeassistant.const import REVOLUTIONS_PER_MINUTE
from homeassistant.const import UnitOfPower
from homeassistant.const import UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
from homeassistant.helpers.update_coordinator import CoordinatorEntity

from .const import DOMAIN, JOULES_PER_TERA_HASH, TERA_HASH_PER_SECOND
from .const import DOMAIN
from .const import JOULES_PER_TERA_HASH
from .const import TERA_HASH_PER_SECOND
from .coordinator import MinerCoordinator

_LOGGER = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ colorlog==6.7.0
homeassistant>=2024.1.0
pip>=21.0,<23.2
ruff==0.0.267
pyasic==0.48.4
pyasic==0.48.5
pre-commit

0 comments on commit 90785ad

Please sign in to comment.