Use f-strings in integrations starting with "M" (#32271)
* Use f-strings in integrations starting with "M" * Format mqtt light init with black * Fix lint error * Fix pylint error * Restore constants * Update homeassistant/components/mqtt/discovery.py * Update homeassistant/components/mqtt/discovery.py * Update homeassistant/components/mqtt/discovery.py * Update homeassistant/components/mqtt/discovery.py * Format with Black
This commit is contained in:
1 parent
bbe0f75336
commit
ba0aaeeddb
34 files changed
+62
-80
No files matched your search
@@ -5,7 +5,7 @@ import logging
|
||||
from pyps4_2ndscreen.errors import NotReady, PSDataIncomplete
|
||||
import pyps4_2ndscreen.ps4 as pyps4
|
||||
|
||||
from homeassistant.components.media_player import ENTITY_IMAGE_URL, MediaPlayerDevice
|
||||
from homeassistant.components.media_player import MediaPlayerDevice
|
||||
from homeassistant.components.media_player.const import (
|
||||
ATTR_MEDIA_CONTENT_TYPE,
|
||||
ATTR_MEDIA_TITLE,
|
||||
@@ -387,8 +387,9 @@ class PS4Device(MediaPlayerDevice):
|
||||
if self._state == STATE_PLAYING and self._media_content_id is not None:
|
||||
image_hash = self.media_image_hash
|
||||
if image_hash is not None:
|
||||
return ENTITY_IMAGE_URL.format(
|
||||
self.entity_id, self.access_token, image_hash
|
||||
return (
|
||||
f"/api/media_player_proxy/{self.entity_id}?"
|
||||
f"token={self.access_token}&cache={image_hash}"
|
||||
)
|
||||
return MEDIA_IMAGE_DEFAULT
|
||||
|
||||
|
||||
Reference in new issue
Block a user