@pierre-gilles
Para la recuperación automática de la MAC, he revisado lo que actualmente devuelve scanNetwork('ssdp').
Para mi TV LG, obtengo:
{
"source_ip": "192.168.1.71",
"source_port": 49363,
"headers": "..."
}
La MAC no está presente en la respuesta SSDP en sí.
¿Sería posible que el escaneo intermedio agregue un source_mac cuando pueda resolver la IP a través de la tabla ARP/vecinos del host?
Por ejemplo:
{
"source_ip": "192.168.1.71",
"source_mac": "64:e4:a5:b4:88:74",
"source_port": 49363,
"headers": "..."
}
Esto permitiría a las integraciones que utilizan Wake-on-LAN recuperar automáticamente la MAC durante el descubrimiento, sin pedirle al usuario que la ingrese manualmente.
¿Qué opinas?
ouvert 08:38AM - 15 Aug 26 UTC
fermé 12:04PM - 24 Aug 26 UTC
claude:pr-opened
## Feature request
It would be useful for mediated SSDP discovery to expose the… source MAC address when it can be resolved from the source IP.
Currently, an external integration using:
gladys.scanNetwork('ssdp', {
st: 'urn:lge-com:service:webos-second-screen:1',
timeoutSeconds: 5,
});
receives results such as:
{
"source_ip": "192.168.1.71",
"source_port": 49363,
"headers": "HTTP/1.1 200 OK\r\n..."
}
The source IP and port are available, but not the MAC address.
## Use case
Some devices discovered through SSDP also support Wake-on-LAN.
For example, an integration can automatically discover a device IP through SSDP, but still needs to ask the user to manually enter its MAC address before Wake-on-LAN can be used.
Since the SSDP scan is mediated by Gladys on the host network, it could be useful for Gladys to resolve the source IP through the ARP/neighbour table when possible.
## Proposed result
When the MAC address can be resolved, the SSDP result could include an optional `source_mac` field:
{
"source_ip": "192.168.1.71",
"source_mac": "64:e4:a5:b4:88:74",
"source_port": 49363,
"headers": "HTTP/1.1 200 OK\r\n..."
}
`source_mac` would remain optional, since MAC resolution may not always be possible.
## Benefits
This would allow external integrations to:
- automatically configure Wake-on-LAN after device discovery;
- avoid asking users to manually find and enter a MAC address;
- associate an IP address with a more stable network identifier;
- keep network discovery logic centralized in Gladys instead of requiring additional network permissions inside integration containers.
This is not specific to LG webOS and could benefit any external integration discovering Wake-on-LAN capable devices through SSDP.