Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Jan 25, 2024
1 parent d17e3da commit 5cc3cdf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions custom_components/battery_notes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
from __future__ import annotations

import logging
import re
from datetime import datetime
from dataclasses import dataclass, field

import homeassistant.helpers.config_validation as cv
import voluptuous as vol
import re

from awesomeversion.awesomeversion import AwesomeVersion
from homeassistant.components.homeassistant import exposed_entities
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.const import __version__ as HA_VERSION # noqa: N812
Expand Down Expand Up @@ -53,7 +52,6 @@
SERVICE_BATTERY_REPLACED_SCHEMA,
SERVICE_DATA_DATE_TIME_REPLACED,
DATA_STORE,
DATA_COORDINATOR,
ATTR_REMOVE,
ATTR_DEVICE_ID,
CONF_BATTERY_TYPE,
Expand Down
1 change: 1 addition & 0 deletions custom_components/battery_notes/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ def extra_state_attributes(self) -> dict[str, str] | None:


def isfloat(num):
"""Is the value a float."""
try:
float(num)
return True
Expand Down
4 changes: 2 additions & 2 deletions custom_components/battery_notes/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ async def async_setup(self) -> bool:
for entity in entity_registry.entities.values():
if not entity.device_id or entity.device_id != device_id:
continue
if not entity.domain or not entity.domain in {
if not entity.domain or entity.domain not in {
BINARY_SENSOR_DOMAIN,
SENSOR_DOMAIN,
}:
continue
if not entity.platform or entity.platform == DOMAIN:
continue
device_class = entity.device_class or entity.original_device_class
if not device_class == SensorDeviceClass.BATTERY:
if device_class != SensorDeviceClass.BATTERY:
continue

self.wrapped_battery = entity_registry.async_get(entity.entity_id)
Expand Down

0 comments on commit 5cc3cdf

Please sign in to comment.