Perspecrive CUSTOOM - Color Script Question

As you can see in the attached picture, an error occurred.
"AttributeError: 'NoneType' object has no attribute 'group' "

I don't know how to go about solving this.

Please tell us.

Your color dictionary isn't valid JSON. You can check it on https:jsonlint.org.

{
	color: ,
	theme: light
}

returns

Error: Parse error on line 1:
{	color: ,	theme: lig
--^
Expecting 'STRING', '}', got 'undefined'

I would expect it to look like {"color": "#112233", "theme": "light"}.


Tip: Your question has nothing to do with "building management system". Use a title that describes the problem so the right people read your post.

I'm not sure what you're talking about because it's my first time using ignition.

Do you want me to delete the existing script and put what you said?

tip #2:

iterable[i] for i in range(len(iterable))

is more easily expressed using

x for x in iterable

So, line 37 could be written like this:

result = [2 * x for x in result]

Line 35 is a bit different. You could use zip or enumerate, but I think it doesn't look very good.
But, you already know this line is only run on a known length, which is quite small.
So, you could just do this:

r = result
result = [r[0]+r[1], r[2]+r[3], r[4]+r[5]]

This is simple, more efficient than looping (though that doesn't matter here), but more importantly you know at first glance what's going on. It's much easier to eye-parse than a list comprehension using range(len(something), 2)

If you look at the expression structure at the bottom left (beside the error message) you can see that 'color' has no value. Your {view.params.color} parameter is empty or Python type 'None'.

All right. Let's try.