Skip to content

Commit 70e3d1b

Browse files
committed
Merge pull request gpiozero#341 from lurch/deprecate_CompositeDevice_all
remove usage of CompositeDevice.all since it's marked as deprecated
2 parents 963b962 + 4237129 commit 70e3d1b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gpiozero/boards.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ def on(self):
5252
"""
5353
Turn all the output devices on.
5454
"""
55-
for device in self.all:
55+
for device in self:
5656
if isinstance(device, (OutputDevice, CompositeOutputDevice)):
5757
device.on()
5858

5959
def off(self):
6060
"""
6161
Turn all the output devices off.
6262
"""
63-
for device in self.all:
63+
for device in self:
6464
if isinstance(device, (OutputDevice, CompositeOutputDevice)):
6565
device.off()
6666

@@ -69,7 +69,7 @@ def toggle(self):
6969
Toggle all the output devices. For each device, if it's on, turn it
7070
off; if it's off, turn it on.
7171
"""
72-
for device in self.all:
72+
for device in self:
7373
if isinstance(device, (OutputDevice, CompositeOutputDevice)):
7474
device.toggle()
7575

@@ -83,7 +83,7 @@ def value(self):
8383

8484
@value.setter
8585
def value(self, value):
86-
for device, v in zip(self.all, value):
86+
for device, v in zip(self, value):
8787
if isinstance(device, (OutputDevice, CompositeOutputDevice)):
8888
device.value = v
8989
# Simply ignore values for non-output devices
@@ -915,7 +915,7 @@ def transmit(self, socket, enable):
915915
with self._lock:
916916
try:
917917
code = (8 * bool(enable)) + (8 - socket)
918-
for bit in self.all[:4]:
918+
for bit in self[:4]:
919919
bit.value = (code & 1)
920920
code >>= 1
921921
sleep(0.1)

0 commit comments

Comments
 (0)