mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix implicit-return in squeezebox (#122928)
This commit is contained in:
parent
55e5428443
commit
2fd3c42e63
@ -3,7 +3,7 @@
|
||||
import asyncio
|
||||
from http import HTTPStatus
|
||||
import logging
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from pysqueezebox import Server, async_discover
|
||||
import voluptuous as vol
|
||||
@ -102,7 +102,7 @@ class SqueezeboxConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
# update with suggested values from discovery
|
||||
self.data_schema = _base_schema(self.discovery_info)
|
||||
|
||||
async def _validate_input(self, data):
|
||||
async def _validate_input(self, data: dict[str, Any]) -> str | None:
|
||||
"""Validate the user input allows us to connect.
|
||||
|
||||
Retrieve unique id and abort if already configured.
|
||||
@ -129,6 +129,8 @@ class SqueezeboxConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
await self.async_set_unique_id(status["uuid"])
|
||||
self._abort_if_unique_id_configured()
|
||||
|
||||
return None
|
||||
|
||||
async def async_step_user(self, user_input=None):
|
||||
"""Handle a flow initialized by the user."""
|
||||
errors = {}
|
||||
|
@ -281,10 +281,11 @@ class SqueezeBoxEntity(MediaPlayerEntity):
|
||||
self.hass.data[DOMAIN][KNOWN_PLAYERS].remove(self)
|
||||
|
||||
@property
|
||||
def volume_level(self):
|
||||
def volume_level(self) -> float | None:
|
||||
"""Volume level of the media player (0..1)."""
|
||||
if self._player.volume:
|
||||
return int(float(self._player.volume)) / 100.0
|
||||
return None
|
||||
|
||||
@property
|
||||
def is_volume_muted(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user