<reponame>HansKappert/net_balancer
class P1reader:
    def __init__(self, port, huidig_afname = 0, huidige_teruglever = 1200) -> None:
        self.huidig_afname = huidig_afname
        self.huidige_teruglever = huidige_teruglever
        return


    def read_data(self):
        p1_line = \
        '1-3:0.2.8(42)\r' + \
        '0-0:1.0.0(210529154722S)\r' + \
        '0-0:96.1.1(4530303236333030303334303439363136)\r' + \
        '1-0:1.8.1(011827.640*kWh)\r' + \
        '1-0:1.8.2(009437.621*kWh)\r' + \
        '1-0:2.8.1(001798.980*kWh)\r' + \
        '1-0:2.8.2(004382.306*kWh)\r' + \
        '0-0:96.14.0(0001)\r' + \
        f'1-0:1.7.0({self.huidig_afname/1000:.3f}*kW)\r' + \
        f'1-0:2.7.0({self.huidige_teruglever/1000:.3f}*kW)\r' + \
        '0-0:96.7.21(00000)\r' + \
        '0-0:96.7.9(00000)\r' + \
        '1-0:99.97.0(1)(0-0:96.7.19)(000101000017W)(2147483647*s)\r' + \
        '1-0:32.32.0(00008)\r' + \
        '1-0:52.32.0(00008)\r' + \
        '1-0:72.32.0(00011)\r' + \
        '1-0:32.36.0(00000)\r' + \
        '1-0:52.36.0(00000)\r' + \
        '1-0:72.36.0(00000)\r' + \
        '0-0:96.13.1()\r' + \
        '0-0:96.13.0()\r' + \
        '1-0:31.7.0(000*A)\r' + \
        '1-0:51.7.0(003*A)\r' + \
        '1-0:71.7.0(002*A)\r' + \
        '1-0:21.7.0(00.002*kW)\r' + \
        '1-0:41.7.0(00.000*kW)\r' + \
        '1-0:61.7.0(00.000*kW)\r' + \
        '1-0:22.7.0(00.000*kW)\r' + \
        '1-0:42.7.0(00.780*kW)\r' + \
        '1-0:62.7.0(00.470*kW)\r' + \
        '0-1:24.1.0(003)\r' + \
        '0-1:96.1.0(4730303332353631323838313236303137)\r' + \
        '0-1:24.2.1(210529150000S)(03072.410*m3)'
        data_frame = p1_line.split('\r')
        return data_frame, ""
class P1reader:
    def __init__(self, port, huidig_afname = 0, huidige_teruglever = 1200) -> None:
        self.huidig_afname = huidig_afname
        self.huidige_teruglever = huidige_teruglever
        return


    def read_data(self):
        p1_line = \
        '1-3:0.2.8(42)\r' + \
        '0-0:1.0.0(210529154722S)\r' + \
        '0-0:96.1.1(4530303236333030303334303439363136)\r' + \
        '1-0:1.8.1(011827.640*kWh)\r' + \
        '1-0:1.8.2(009437.621*kWh)\r' + \
        '1-0:2.8.1(001798.980*kWh)\r' + \
        '1-0:2.8.2(004382.306*kWh)\r' + \
        '0-0:96.14.0(0001)\r' + \
        f'1-0:1.7.0({self.huidig_afname/1000:.3f}*kW)\r' + \
        f'1-0:2.7.0({self.huidige_teruglever/1000:.3f}*kW)\r' + \
        '0-0:96.7.21(00000)\r' + \
        '0-0:96.7.9(00000)\r' + \
        '1-0:99.97.0(1)(0-0:96.7.19)(000101000017W)(2147483647*s)\r' + \
        '1-0:32.32.0(00008)\r' + \
        '1-0:52.32.0(00008)\r' + \
        '1-0:72.32.0(00011)\r' + \
        '1-0:32.36.0(00000)\r' + \
        '1-0:52.36.0(00000)\r' + \
        '1-0:72.36.0(00000)\r' + \
        '0-0:96.13.1()\r' + \
        '0-0:96.13.0()\r' + \
        '1-0:31.7.0(000*A)\r' + \
        '1-0:51.7.0(003*A)\r' + \
        '1-0:71.7.0(002*A)\r' + \
        '1-0:21.7.0(00.002*kW)\r' + \
        '1-0:41.7.0(00.000*kW)\r' + \
        '1-0:61.7.0(00.000*kW)\r' + \
        '1-0:22.7.0(00.000*kW)\r' + \
        '1-0:42.7.0(00.780*kW)\r' + \
        '1-0:62.7.0(00.470*kW)\r' + \
        '0-1:24.1.0(003)\r' + \
        '0-1:96.1.0(4730303332353631323838313236303137)\r' + \
        '0-1:24.2.1(210529150000S)(03072.410*m3)'
        data_frame = p1_line.split('\r')
        return data_frame, ""