ekmmeters.py
def setSeasonSchedules(self, cmd_dict=None, password="00000000"):
        """ Serial command to set seasons table.

        If no dictionary is passed, the meter object buffer is used.

        Args:
            cmd_dict (dict): Optional dictionary of season schedules.
            password (str): Optional password

        Returns:
            bool: True on completion and ACK.
        """
        result = False
        self.setContext("setSeasonSchedules")

        if not cmd_dict:
            cmd_dict = self.m_seasons_sched_params

        try:
            if not self.request(False):
                self.writeCmdMsg("Bad read CRC on setting")
            else:
                if not self.serialCmdPwdAuth(password):
                    self.writeCmdMsg("Password failure")
                else:
                    req_table = ""
                    req_table += binascii.hexlify(str(cmd_dict["Season_1_Start_Month"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_1_Start_Day"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_1_Schedule"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_2_Start_Month"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_2_Start_Day"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_2_Schedule"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_3_Start_Month"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_3_Start_Day"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_3_Schedule"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_4_Start_Month"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_4_Start_Day"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_4_Schedule"]).zfill(2))
                    req_table += binascii.hexlify(str(0).zfill(24))
                    req_str = "015731023030383028" + req_table + "2903"
                    req_str += self.calc_crc16(req_str[2:].decode("hex"))
                    self.m_serial_port.write(req_str.decode("hex"))
                    if self.m_serial_port.getResponse(self.getContext()).encode("hex") == "06":
                        self.writeCmdMsg("Success(setSeasonSchedules): 06 returned.")
                        result = True
            self.serialPostEnd()
        except:
            ekm_log(traceback.format_exc(sys.exc_info()))

        self.setContext("")
        return result
def setSeasonSchedules(self, cmd_dict=None, password="00000000"):
        """ Serial command to set seasons table.

        If no dictionary is passed, the meter object buffer is used.

        Args:
            cmd_dict (dict): Optional dictionary of season schedules.
            password (str): Optional password

        Returns:
            bool: True on completion and ACK.
        """
        result = False
        self.setContext("setSeasonSchedules")

        if not cmd_dict:
            cmd_dict = self.m_seasons_sched_params

        try:
            if not self.request(False):
                self.writeCmdMsg("Bad read CRC on setting")
            else:
                if not self.serialCmdPwdAuth(password):
                    self.writeCmdMsg("Password failure")
                else:
                    req_table = ""
                    req_table += binascii.hexlify(str(cmd_dict["Season_1_Start_Month"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_1_Start_Day"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_1_Schedule"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_2_Start_Month"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_2_Start_Day"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_2_Schedule"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_3_Start_Month"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_3_Start_Day"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_3_Schedule"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_4_Start_Month"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_4_Start_Day"]).zfill(2))
                    req_table += binascii.hexlify(str(cmd_dict["Season_4_Schedule"]).zfill(2))
                    req_table += binascii.hexlify(str(0).zfill(24))
                    req_str = "015731023030383028" + req_table + "2903"
                    req_str += self.calc_crc16(req_str[2:].decode("hex"))
                    self.m_serial_port.write(req_str.decode("hex"))
                    if self.m_serial_port.getResponse(self.getContext()).encode("hex") == "06":
                        self.writeCmdMsg("Success(setSeasonSchedules): 06 returned.")
                        result = True
            self.serialPostEnd()
        except:
            ekm_log(traceback.format_exc(sys.exc_info()))

        self.setContext("")
        return result
Serial command to set seasons table.

        If no dictionary is passed, the meter object buffer is used.

        Args:
            cmd_dict (dict): Optional dictionary of season schedules.
            password (str): Optional password

        Returns:
            bool: True on completion and ACK.