Switch a Socket

def switch_onoff(self, device, status):
        """Switch a Socket"""
        if status == 1 or status == True or status == '1':
            return self.switch_on(device)
        else:
            return self.switch_off(device)