Skip to content

Commit f222215

Browse files
committed
Added display of POE Power for ports with no data connection (power only)
1 parent cfdbbf7 commit f222215

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

unifi.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
# removed "ports" from AP definitions as not needed.
2525
# can now read unifi data directly to draw device.
2626
# N Waterton V 1.2.1 29th july 2019 - Fixes for Flex 5 POE Switch.
27+
# N Waterton V 1.2.2 23 August 2019 - Add display of POE power and port name even if port is not used for data, if POE power consumption >0
2728

28-
__VERSION__ = '1.2.1'
29+
__VERSION__ = '1.2.2'
2930

3031
import gi
3132
gi.require_version('GLib', '2.0')
@@ -795,7 +796,8 @@ def draw_port(self):
795796

796797
Grx.draw_text(str(self.port_number), self.x+self.port_width//2, self.y-self.text_height, port_number_text_opts)
797798
Grx.draw_filled_rounded_box(self.x, self.y, self.x+self.port_width, self.y+self.port_height, 3, color)
798-
if color == self.black:
799+
if color == self.black and float(self.power)==0:
800+
log.info("POWER: %s" % self.power)
799801
port_color = self.white
800802
if not self.enabled:
801803
port_color = self.red

0 commit comments

Comments
 (0)