Skip to content

Commit

Permalink
Fixed flash_all function (#18)
Browse files Browse the repository at this point in the history
* fixed flash_all
* added blackout after delay in flash_all
* version bump
  • Loading branch information
vishnumg authored Feb 7, 2022
1 parent 578c5db commit c0cfc9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(name='stupidArtnet',
author='cpvalente',
version='1.1.0',
version='1.1.1',
license='MIT',
description='(Very) Simple implementation of the Art-Net protocol',
long_description=long_description,
Expand Down
13 changes: 7 additions & 6 deletions stupidArtnet/StupidArtnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import socket
from threading import Timer
from stupidArtnet.ArtnetUtils import shift_this, put_in_range

from time import sleep

class StupidArtnet():
"""(Very) simple implementation of Artnet."""
Expand Down Expand Up @@ -301,14 +301,15 @@ def blackout(self):
self.clear()
self.show()

def flash_all(self):
def flash_all(self, delay=None):
"""Sends 255's all across."""
packet = bytearray(self.PACKET_SIZE)
[255 for i in packet]
# for i in range(self.PACKET_SIZE):
# packet[i] = 255
packet = [255] * self.PACKET_SIZE
self.set(packet)
self.show()
# Blackout after delay
if delay:
sleep(delay)
self.blackout()


if __name__ == '__main__':
Expand Down

0 comments on commit c0cfc9e

Please sign in to comment.