@@ -27,20 +27,20 @@ async def get(self, effect_id) -> web.Response:
2727 return web .json_response (data = response , status = 400 )
2828
2929 if effect_id in self ._ledfx .config ["ledfx_presets" ].keys ():
30- ledfx_presets = self ._ledfx .config ["ledfx_presets" ][effect_id ]
30+ default = self ._ledfx .config ["ledfx_presets" ][effect_id ]
3131 else :
32- ledfx_presets = {}
32+ default = {}
3333
3434 if effect_id in self ._ledfx .config ["user_presets" ].keys ():
35- user_presets = self ._ledfx .config ["user_presets" ][effect_id ]
35+ custom = self ._ledfx .config ["user_presets" ][effect_id ]
3636 else :
37- user_presets = {}
37+ custom = {}
3838
3939 response = {
4040 "status" : "success" ,
4141 "effect" : effect_id ,
42- "ledfx_presets " : ledfx_presets ,
43- "user_presets " : user_presets ,
42+ "default_presets " : default ,
43+ "custom_presets " : custom ,
4444 }
4545 return web .json_response (data = response , status = 200 )
4646
@@ -65,7 +65,9 @@ async def put(self, effect_id, request) -> web.Response:
6565 if category not in ["ledfx_presets" , "user_presets" ]:
6666 response = {
6767 "status" : "failed" ,
68- "reason" : f'Category { category } is not "ledfx_presets" or "user_presets"' ,
68+ "reason" : 'Category {} is not "ledfx_presets" or "user_presets"' .format (
69+ category
70+ ),
6971 }
7072 return web .json_response (data = response , status = 400 )
7173
@@ -79,7 +81,9 @@ async def put(self, effect_id, request) -> web.Response:
7981 if effect_id not in self ._ledfx .config [category ].keys ():
8082 response = {
8183 "status" : "failed" ,
82- "reason" : f"Effect { effect_id } does not exist in category { category } " ,
84+ "reason" : "Effect {} does not exist in category {}" .format (
85+ effect_id , category
86+ ),
8387 }
8488 return web .json_response (data = response , status = 400 )
8589
@@ -102,7 +106,9 @@ async def put(self, effect_id, request) -> web.Response:
102106 if preset_id not in self ._ledfx .config [category ][effect_id ].keys ():
103107 response = {
104108 "status" : "failed" ,
105- "reason" : f"Preset { preset_id } does not exist for effect { effect_id } in category { category } " ,
109+ "reason" : "Preset {} does not exist for effect {} in category {}" .format (
110+ preset_id , effect_id , category
111+ ),
106112 }
107113 return web .json_response (data = response , status = 400 )
108114
@@ -142,7 +148,9 @@ async def delete(self, effect_id, request) -> web.Response:
142148 if category not in ["ledfx_presets" , "user_presets" ]:
143149 response = {
144150 "status" : "failed" ,
145- "reason" : f'Category { category } is not "ledfx_presets" or "user_presets"' ,
151+ "reason" : 'Category {} is not "ledfx_presets" or "user_presets"' .format (
152+ category
153+ ),
146154 }
147155 return web .json_response (data = response , status = 400 )
148156
@@ -165,7 +173,9 @@ async def delete(self, effect_id, request) -> web.Response:
165173 if effect_id not in self ._ledfx .config [category ].keys ():
166174 response = {
167175 "status" : "failed" ,
168- "reason" : f"Effect { effect_id } does not exist in category { category } " ,
176+ "reason" : "Effect {} does not exist in category {}" .format (
177+ effect_id , category
178+ ),
169179 }
170180 return web .json_response (data = response , status = 400 )
171181
@@ -179,7 +189,9 @@ async def delete(self, effect_id, request) -> web.Response:
179189 if preset_id not in self ._ledfx .config [category ][effect_id ].keys ():
180190 response = {
181191 "status" : "failed" ,
182- "reason" : f"Preset { preset_id } does not exist for effect { effect_id } in category { category } " ,
192+ "reason" : "Preset {} does not exist for effect {} in category {}" .format (
193+ preset_id , effect_id , category
194+ ),
183195 }
184196 return web .json_response (data = response , status = 400 )
185197
0 commit comments