def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the LG TV platform.""" from pylgnetcast import LgNetCastClient client = LgNetCastClient(config.get(CONF_HOST), config.get(CONF_ACCESS_TOKEN)) add_devices([LgTVDevice(client, config[CONF_NAME])])
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the LG TV platform.""" host = config.get(CONF_HOST) access_token = config.get(CONF_ACCESS_TOKEN) name = config.get(CONF_NAME) client = LgNetCastClient(host, access_token) add_entities([LgTVDevice(client, name)], True)
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the LG TV platform.""" host = config.get(CONF_HOST) access_token = config.get(CONF_ACCESS_TOKEN) name = config.get(CONF_NAME) on_action = config.get(CONF_ON_ACTION) client = LgNetCastClient(host, access_token) on_action_script = Script(hass, on_action) if on_action else None add_entities([LgTVDevice(client, name, on_action_script)], True)
def setup_platform( hass: HomeAssistant, config: ConfigType, add_entities: AddEntitiesCallback, discovery_info: DiscoveryInfoType | None = None, ) -> None: """Set up the LG TV platform.""" host = config.get(CONF_HOST) access_token = config.get(CONF_ACCESS_TOKEN) name = config[CONF_NAME] on_action = config.get(CONF_ON_ACTION) client = LgNetCastClient(host, access_token) on_action_script = Script(hass, on_action, name, DOMAIN) if on_action else None add_entities([LgTVDevice(client, name, on_action_script)], True)