mirror of
https://github.com/natekspencer/hacs-oasis_mini.git
synced 2025-12-06 18:44:14 -05:00
Add noqa: ARG001 on unused hass
This commit is contained in:
@@ -77,7 +77,7 @@ class OasisDevice:
|
||||
model (str | None): Device model identifier.
|
||||
serial_number (str | None): Device serial number.
|
||||
name (str | None): Human-readable device name; if omitted, defaults to "<model> <serial_number>".
|
||||
ssid (str | None): Last-known Wi‑Fi SSID for the device.
|
||||
ssid (str | None): Last-known Wi-Fi SSID for the device.
|
||||
ip_address (str | None): Last-known IP address for the device.
|
||||
cloud (OasisCloudClient | None): Optional cloud client used to fetch track metadata and remote data.
|
||||
client (OasisClientProtocol | None): Optional transport client used to send commands to the device.
|
||||
@@ -436,11 +436,11 @@ class OasisDevice:
|
||||
Returns:
|
||||
dict[int, dict[str, str]]: A mapping from track ID to a details dictionary (contains at least a `'name'` key). If track metadata is available from the device cache or built-in TRACKS it is used; otherwise a fallback `{"name": "Unknown Title (#<id>)"}` is provided.
|
||||
"""
|
||||
base = dict(TRACKS)
|
||||
if (current_id := self.track_id) is not None and self.track:
|
||||
base[current_id] = self.track
|
||||
return {
|
||||
track_id: {self.track_id: self.track or {}, **TRACKS}.get(
|
||||
track_id,
|
||||
{"name": f"Unknown Title (#{track_id})"},
|
||||
)
|
||||
track_id: base.get(track_id, {"name": f"Unknown Title (#{track_id})"})
|
||||
for track_id in self.playlist
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import base64
|
||||
from datetime import UTC, datetime
|
||||
import logging
|
||||
import math
|
||||
from typing import Any
|
||||
from xml.etree.ElementTree import Element, SubElement, tostring
|
||||
|
||||
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
||||
@@ -27,12 +28,12 @@ def _bit_to_bool(val: str) -> bool:
|
||||
return val == "1"
|
||||
|
||||
|
||||
def _parse_int(val: str) -> int:
|
||||
def _parse_int(val: Any | None) -> int:
|
||||
"""
|
||||
Parse a string into an integer, falling back to 0 when conversion fails.
|
||||
|
||||
Parameters:
|
||||
val (str): String potentially containing an integer value.
|
||||
val (Any | None): String potentially containing an integer value.
|
||||
|
||||
Returns:
|
||||
int: The parsed integer, or 0 if `val` cannot be converted.
|
||||
|
||||
Reference in New Issue
Block a user