power: Don't query a gpio line in "refresh_status"
On some devices gpiod does not report the correct state. Since Moonraker maintains exclusive control over GPIO lines, its unnecessary to query the line itself for state, as we can maintain it ourselves. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
fd07b077b9
commit
9fe6ef82a5
|
@ -352,14 +352,7 @@ class GpioDevice(PowerDevice):
|
|||
self.set_power("on" if self.initial_state else "off")
|
||||
|
||||
def refresh_status(self):
|
||||
try:
|
||||
val = self.line.get_value()
|
||||
except Exception:
|
||||
self.state = "error"
|
||||
msg = f"Error Refeshing Device Status: {self.name}"
|
||||
logging.exception(msg)
|
||||
raise self.server.error(msg) from None
|
||||
self.state = "on" if val else "off"
|
||||
pass
|
||||
|
||||
def set_power(self, state):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue