MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / get_ap_client_count

Method get_ap_client_count

display.py:619–641  ·  view source on GitHub ↗

Get the number of clients connected to AP mode.

(self)

Source from the content-addressed store, hash-verified

617 wave_spacing = max(2, int(2.5 * scale) + 2)
618 line_width = max(1, int(scale) + 1)
619
620 center_x = base_x + base_radius + wave_spacing * 2
621 center_y = base_y + base_radius + wave_spacing * 2
622
623 # Draw expanding arcs to mimic Wi-Fi waves
624 for i in range(waves):
625 radius = max(2, base_radius + (i + 1) * wave_spacing - 4)
626 bbox = (
627 center_x - radius,
628 center_y - radius,
629 center_x + radius,
630 center_y + radius
631 )
632 draw.arc(bbox, start=225, end=315, fill=0, width=line_width)
633
634 if ip_last_octet:
635 text_x = center_x + wave_spacing + base_radius
636 text_y = center_y - base_radius - max(1, int(6 * _sy))
637 draw.text((text_x, text_y), ip_last_octet, font=self.shared_data.font_arial9, fill=0)
638
639 def get_wifi_ip_last_octet(self):
640 """Get the last octet of the WiFi IP address (e.g., '.211' from '192.168.1.211')."""
641 try:
642 # Get IP address of wlan0 interface
643 result = subprocess.run(['ip', '-4', 'addr', 'show', self._wifi_iface],
644 capture_output=True, text=True, timeout=2)

Callers 1

update_shared_dataMethod · 0.95

Calls 2

errorMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected