Skip to content

Commit 9cee12b

Browse files
authored
Fix images for multi sensors
1 parent 24c4962 commit 9cee12b

File tree

1 file changed

+5
-3
lines changed
  • custom_components/plex_recently_added

1 file changed

+5
-3
lines changed

custom_components/plex_recently_added/sensor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, CONF_SSL
1919
from homeassistant.helpers.entity import Entity
2020

21-
__version__ = '0.2.9'
21+
__version__ = '0.3.0'
2222

2323
_LOGGER = logging.getLogger(__name__)
2424

2525
CONF_DL_IMAGES = 'download_images'
26-
DEFAULT_NAME = 'Plex Recently Added'
26+
DEFAULT_NAME = 'plex_recently_added'
2727
CONF_SERVER = 'server_name'
2828
CONF_SSL_CERT = 'ssl_cert'
2929
CONF_TOKEN = 'token'
@@ -44,7 +44,7 @@
4444
vol.Optional(CONF_SECTION_TYPES,
4545
default=['movie', 'show']): vol.All(cv.ensure_list, [cv.string]),
4646
vol.Optional(CONF_IMG_CACHE,
47-
default='/custom-lovelace/upcoming-media-card/images/plex/'): cv.string
47+
default='/upcoming-media-card-images/plex/'): cv.string
4848
})
4949

5050

@@ -60,6 +60,8 @@ def __init__(self, hass, conf, name):
6060
self._name = name
6161
self.conf_dir = str(hass.config.path()) + '/'
6262
self._dir = conf.get(CONF_IMG_CACHE)
63+
if self._name:
64+
self._dir = self._dir + self._name + '/'
6365
self.img = '{0}{1}{2}{3}{4}.jpg'.format(
6466
self.conf_dir, {}, self._dir, {}, {})
6567
self.img_url = '{0}{1}{2}{3}.jpg'.format({}, self._dir, {}, {})

0 commit comments

Comments
 (0)