code: def publish_mainswitch_state(self, state):
          
          self.sequence_number += 1
          self.publisher.send_multipart(msgs.MessageBuilder.mainswitch_state(self.sequence_number, state))
          return self.sequence_number
docs: publish changed mainswitch state