Mock.py 329 Bytes
Newer Older
Pedro Henrique Kopper's avatar
Pedro Henrique Kopper committed
1 2
from random import random

3
class Mock(object):
4
    def __init__(self, logger, location, channels):
5
        self.channels = len(channels)
6 7
        logger("[MOCK]", "Generating fake data...")
    def read(self, channel):
8 9
        return random() * 20
    def readAll(self):
10
        return [self.read(0) for i in range(self.channels)]