PEP8 and PyLint style fixes
parent
75a0498080
commit
7cc9034815
|
@ -100,12 +100,13 @@ def setup(bus, statemachine):
|
||||||
|
|
||||||
casts = {}
|
casts = {}
|
||||||
|
|
||||||
|
eid_form = ENTITY_ID_FORMAT.format
|
||||||
|
|
||||||
for host in hosts:
|
for host in hosts:
|
||||||
try:
|
try:
|
||||||
cast = pychromecast.PyChromecast(host)
|
cast = pychromecast.PyChromecast(host)
|
||||||
|
|
||||||
entity_id = ENTITY_ID_FORMAT.format(
|
entity_id = eid_form(util.slugify(cast.device.friendly_name))
|
||||||
util.slugify(cast.device.friendly_name))
|
|
||||||
|
|
||||||
casts[entity_id] = cast
|
casts[entity_id] = cast
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,8 @@ def repr_helper(inp):
|
||||||
""" Helps creating a more readable string representation of objects. """
|
""" Helps creating a more readable string representation of objects. """
|
||||||
if isinstance(inp, dict):
|
if isinstance(inp, dict):
|
||||||
return u", ".join(
|
return u", ".join(
|
||||||
repr_helper(key)+u"="+repr_helper(item) for key, item in inp.items()
|
repr_helper(key)+u"="+repr_helper(item) for key, item
|
||||||
)
|
in inp.items())
|
||||||
elif isinstance(inp, list):
|
elif isinstance(inp, list):
|
||||||
return u'[' + u', '.join(inp) + u']'
|
return u'[' + u', '.join(inp) + u']'
|
||||||
elif isinstance(inp, datetime.datetime):
|
elif isinstance(inp, datetime.datetime):
|
||||||
|
|
Loading…
Reference in New Issue