fix: inherit PhoneDriver, and stop asserting a contract the driver rejected

Closes netork#117.

A Yealink is a desk phone. It inherited AccessPointDriver because nothing better
existed, and netOrk reads that role to populate its wireless page, its AP
profile pickers and its SSID drift view — so a phone appeared in all three.
napalm-device-types now has PhoneDriver. TYPE_LABEL comes from it, so the local
override is gone.

The two failing fingerprint tests were asserting the opposite of a deliberate
decision. HTTP_FINGERPRINT carries "yealink" as a heavy but *not* mandatory
rule, with the reason written next to it: some models answer / with a redirect
to their API page, whose body says "yealink" nowhere, and a mandatory rule
disqualifies the driver whenever its pattern is absent. Making it mandatory
would rule out a real phone.

The tests demanded it be mandatory, and the Cisco test then asserted `not
all(...)` over an empty list, which is False. Both now check the property that
actually protects against a false match: none of this driver's patterns appear
on a Cisco page, so it contributes no score and never wins.
This commit is contained in:
Christian Manivong
2026-08-21 13:07:37 +07:00
parent 459178a2f4
commit 33d07bed58
4 changed files with 27 additions and 11 deletions
Binary file not shown.
+2 -3
View File
@@ -21,14 +21,13 @@ import requests
from requests.exceptions import RequestException
from napalm.base.exceptions import ConnectionClosedException, ConnectionException
from napalm_device_types import AccessPointDriver, FingerprintRule
from napalm_device_types import FingerprintRule, PhoneDriver
from napalm_device_types.models import HealthMetricsDict
class YealinkDriver(AccessPointDriver):
class YealinkDriver(PhoneDriver):
"""NAPALM driver for Yealink IP phones (T-series, W-series, CP-series, VP-series)."""
TYPE_LABEL = "Phone"
VENDOR = "Yealink"
DRIVER_NAME = "yealink"