# Buggy code
def __repr__(self):
    return f"piid: {self.iid} ({self.description}): ({self.format}, unit: {self.unit}) (acc: {self.access}, value-list: {self.value_list}, value-range: {self.value_range})"


# Traceback (AttributeError)
Traceback (most recent call last):
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 263, in _decode_generic
res = _get_type_cons(type_)(xs)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 306, in <genexpr>
items = (_decode_dataclass(type_arg, x, infer_missing)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 201, in _decode_dataclass
init_kwargs[field.name] = _decode_generic(field_type,
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 258, in _decode_generic
xs = _decode_items(type_.__args__[0], value, infer_missing)
File "/usr/local/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 648, in __getattr__
raise AttributeError(attr)
AttributeError: __args__

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 263, in _decode_generic
res = _get_type_cons(type_)(xs)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 306, in <genexpr>
items = (_decode_dataclass(type_arg, x, infer_missing)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 201, in _decode_dataclass
init_kwargs[field.name] = _decode_generic(field_type,
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 265, in _decode_generic
res = type_(xs)
File "/usr/local/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 622, in __call__
raise TypeError(f"Type {self._name} cannot be instantiated; "
TypeError: Type List cannot be instantiated; use list() instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/ihor_syerkov/source/temp/python-miio/devtools/miottemplate.py", line 65, in <module>
cli()
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/ihor_syerkov/source/temp/python-miio/devtools/miottemplate.py", line 47, in generate
print(gen.generate())
File "/Users/ihor_syerkov/source/temp/python-miio/devtools/miottemplate.py", line 25, in generate
dev = Device.from_json(self.data)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/api.py", line 76, in from_json
return cls.from_dict(kvs, infer_missing=infer_missing)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/api.py", line 83, in from_dict
return _decode_dataclass(cls, kvs, infer_missing)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 201, in _decode_dataclass
init_kwargs[field.name] = _decode_generic(field_type,
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 265, in _decode_generic
res = type_(xs)
File "/usr/local/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 622, in __call__
raise TypeError(f"Type {self._name} cannot be instantiated; "
TypeError: Type List cannot be instantiated; use list() instead```

# Fixed code
def __repr__(self):
    return f"piid: {self.iid} ({self.description}): ({self.format}, unit: {self.unit}) (acc: {self.access})"