mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-16 13:46:31 +00:00
Show internal network settings (#2152)
This commit is contained in:
parent
144d3921f7
commit
353544085e
@ -8,6 +8,7 @@ import voluptuous as vol
|
|||||||
from ..const import (
|
from ..const import (
|
||||||
ATTR_ADDRESS,
|
ATTR_ADDRESS,
|
||||||
ATTR_DNS,
|
ATTR_DNS,
|
||||||
|
ATTR_DOCKER,
|
||||||
ATTR_GATEWAY,
|
ATTR_GATEWAY,
|
||||||
ATTR_ID,
|
ATTR_ID,
|
||||||
ATTR_INTERFACE,
|
ATTR_INTERFACE,
|
||||||
@ -18,6 +19,8 @@ from ..const import (
|
|||||||
ATTR_NAMESERVERS,
|
ATTR_NAMESERVERS,
|
||||||
ATTR_PRIMARY,
|
ATTR_PRIMARY,
|
||||||
ATTR_TYPE,
|
ATTR_TYPE,
|
||||||
|
DOCKER_NETWORK,
|
||||||
|
DOCKER_NETWORK_MASK,
|
||||||
)
|
)
|
||||||
from ..coresys import CoreSysAttributes
|
from ..coresys import CoreSysAttributes
|
||||||
from ..dbus.const import InterfaceMethodSimple
|
from ..dbus.const import InterfaceMethodSimple
|
||||||
@ -64,7 +67,15 @@ class APINetwork(CoreSysAttributes):
|
|||||||
self.sys_host.network.interfaces[interface].name
|
self.sys_host.network.interfaces[interface].name
|
||||||
] = interface_information(self.sys_host.network.interfaces[interface])
|
] = interface_information(self.sys_host.network.interfaces[interface])
|
||||||
|
|
||||||
return {ATTR_INTERFACES: interfaces}
|
return {
|
||||||
|
ATTR_INTERFACES: interfaces,
|
||||||
|
ATTR_DOCKER: {
|
||||||
|
ATTR_INTERFACE: DOCKER_NETWORK,
|
||||||
|
ATTR_ADDRESS: str(DOCKER_NETWORK_MASK),
|
||||||
|
ATTR_GATEWAY: str(self.sys_docker.network.gateway),
|
||||||
|
ATTR_DNS: str(self.sys_docker.network.dns),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
@api_process
|
@api_process
|
||||||
async def interface_info(self, request: web.Request) -> Dict[str, Any]:
|
async def interface_info(self, request: web.Request) -> Dict[str, Any]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user