GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( f7c16c...141f85 )
by Benjamin
02:01
created

Led.__init__()   A

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
1
class Led(object):
2
    def __init__(self, bus, address, port):
3
        self.bus = bus
4
        self.address = address
5
        self.port = port
6
        self.active = False
7
8
    def activate(self):
9
        self.__toggle(True)
10
        self.active = True
11
12
    def deactivate(self):
13
        self.__toggle(False)
14
        self.active = False
15
16
    def __toggle(self, state):
17
        state_list = list(bin(self.active)[2:].zfill(8))
18
19
        state_list[self.port] = int(state)
20
        state = ''.join(state_list)
21
22
        state = int(state, 2)
23
        self.bus.write_byte(self.address, state)
24