diff options
-rw-r--r-- | pychassisctl/chassis_control.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/pychassisctl/chassis_control.py b/pychassisctl/chassis_control.py index 2a6f175..fbe0f72 100644 --- a/pychassisctl/chassis_control.py +++ b/pychassisctl/chassis_control.py @@ -119,9 +119,7 @@ class ChassisControlObject(DbusProperties, DbusObjectManager): in_signature='', out_signature='') def reboot(self): print("Rebooting") - if self.getPowerState() == POWER_OFF: - self.powerOn() - else: + if self.getPowerState() != POWER_OFF: self.Set(DBUS_NAME, "reboot", 1) self.powerOff() return None @@ -130,9 +128,7 @@ class ChassisControlObject(DbusProperties, DbusObjectManager): in_signature='', out_signature='') def softReboot(self): print("Soft Rebooting") - if self.getPowerState() == POWER_OFF: - self.powerOn() - else: + if self.getPowerState() != POWER_OFF: self.Set(DBUS_NAME, "reboot", 1) self.softPowerOff() return None |