publish changed mainswitch state

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