Code quality Local IP (#82050)

This commit is contained in:
G Johansson 2022-11-24 20:39:14 +01:00 committed by GitHub
parent 815dfe9134
commit 3b0a42f8f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View file

@ -12,8 +12,6 @@ from .const import DOMAIN
class SimpleConfigFlow(ConfigFlow, domain=DOMAIN): class SimpleConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for local_ip.""" """Handle a config flow for local_ip."""
VERSION = 1
async def async_step_user( async def async_step_user(
self, user_input: dict[str, Any] | None = None self, user_input: dict[str, Any] | None = None
) -> FlowResult: ) -> FlowResult:

View file

@ -7,7 +7,7 @@ from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN, SENSOR from .const import SENSOR
async def async_setup_entry( async def async_setup_entry(
@ -16,7 +16,7 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback, async_add_entities: AddEntitiesCallback,
) -> None: ) -> None:
"""Set up the platform from config_entry.""" """Set up the platform from config_entry."""
name = entry.data.get(CONF_NAME) or DOMAIN name = entry.data.get(CONF_NAME) or "Local IP"
async_add_entities([IPSensor(name)], True) async_add_entities([IPSensor(name)], True)