parameters: (hass: core.HomeAssistant, data)
return_statement: return {
          "title": f"{deviceInfo['deviceName']} {deviceInfo['deviceID']}",
          "host": data["host"],
          "port": data["port"],
          "password": data["password"],
      }
docstring: Validate the user input allows us to connect.
docstring_summary: Validate the user input allows us to connect.
docstring_tokens: Validate the user input allows us to connect .
function: async def validate_input(hass: core.HomeAssistant, data):
      """Validate the user input allows us to connect."""
      session = async_get_clientsession(hass)
      fully = FullyKiosk(session, data["host"], data["port"], data["password"])
  
      try:
          with timeout(15):
              deviceInfo = await fully.getDeviceInfo()
      except (FullyKioskError, ClientConnectorError):
          raise CannotConnect
  
      # If you cannot connect:
      # throw CannotConnect
      # If the authentication is wrong:
      # InvalidAuth
  
      # Return info that you want to store in the config entry.
      return {
          "title": f"{deviceInfo['deviceName']} {deviceInfo['deviceID']}",
          "host": data["host"],
          "port": data["port"],
          "password": data["password"],
      }
function_tokens: async def validate_input ( hass : core . HomeAssistant , data ) : session = async_get_clientsession ( hass ) fully = FullyKiosk ( session , data [ "host" ] , data [ "port" ] , data [ "password" ] ) try : with timeout ( 15 ) : deviceInfo = await fully . getDeviceInfo ( ) except ( FullyKioskError , ClientConnectorError ) : raise CannotConnect # If you cannot connect: # throw CannotConnect # If the authentication is wrong: # InvalidAuth # Return info that you want to store in the config entry. return { "title" : f"{deviceInfo['deviceName']} {deviceInfo['deviceID']}" , "host" : data [ "host" ] , "port" : data [ "port" ] , "password" : data [ "password" ] , }