from random import random

from .component import Component


class TestComponent(Component):
    def __init__(
        self,
        config=None,
        name=None,
        period=1,
        lazy=True,
        paused=False,
        threaded=True,
    ):
        super().__init__(
            config=config,
            name=name,
            period=period,
            lazy=lazy,
            paused=paused,
            threaded=threaded,
        )
        self.parameter = self.config[self.name]["parameter"]

    def _get(self, data=None):
        super()._get([self.parameter] + [random() for i in range(2)])

    def _set(self, val=None):
        super()._set(val)
