Skip to content

Commit 28648fc

Browse files
authored
Sensor data as object, rename directory name w/ spaces
1 parent 9cee12b commit 28648fc

File tree

1 file changed

+4
-4
lines changed
  • custom_components/plex_recently_added

1 file changed

+4
-4
lines changed

custom_components/plex_recently_added/sensor.py

Lines changed: 4 additions & 4 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.3.0'
21+
__version__ = '0.3.1'
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'
@@ -61,7 +61,7 @@ def __init__(self, hass, conf, name):
6161
self.conf_dir = str(hass.config.path()) + '/'
6262
self._dir = conf.get(CONF_IMG_CACHE)
6363
if self._name:
64-
self._dir = self._dir + self._name + '/'
64+
self._dir = self._dir + self._name.replace(' ', '_') + '/'
6565
self.img = '{0}{1}{2}{3}{4}.jpg'.format(
6666
self.conf_dir, {}, self._dir, {}, {})
6767
self.img_url = '{0}{1}{2}{3}.jpg'.format({}, self._dir, {}, {})
@@ -184,7 +184,7 @@ def device_state_attributes(self):
184184
False, fanart)
185185
self.card_json.append(card_item)
186186
self.change_detected = False
187-
attributes['data'] = json.dumps(self.card_json)
187+
attributes['data'] = self.card_json
188188
return attributes
189189

190190
def update(self):

0 commit comments

Comments
 (0)