From 9af7956a8f03c660097b75204a04367106df40a3 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Thu, 17 Feb 2022 06:13:24 +0100 Subject: [PATCH] Fix bad attribute name --- omnia/leds.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/omnia/leds.py b/omnia/leds.py index df133f5..088554a 100644 --- a/omnia/leds.py +++ b/omnia/leds.py @@ -21,11 +21,11 @@ class LED: @property def state(self) -> LedState: - with open(self.path/'color') as f: + with open(self.dir/'color') as f: r, g, b = [int(x) for x in r.read().strip().split()] - with open(self.path/'brightness') as f: + with open(self.dir/'brightness') as f: brightness = int(f.read.strip()) - with open(self.path/'autonomous') as f: + with open(self.dir/'autonomous') as f: autonomous = bool(f.read.strip()) return LedState(r=r, g=g, b=b, brightness=brightness, autonomous=autonomous) @@ -40,11 +40,11 @@ class LED: setattr(state, attr, old_value) # Set it - with open(self.path/'color', 'w') as f: + with open(self.dir/'color', 'w') as f: f.write(f'{state.r} {state.g} {state.b}\n') - with open(self.path/'brightness', 'w') as f: + with open(self.dir/'brightness', 'w') as f: f.write(str(state.brightness)+'\n') - with open(self.path/'autonomous', 'w') as f: + with open(self.dir/'autonomous', 'w') as f: f.write(str(int(state.autonomous))+'\n') def unalias(s):