Skip to content

EvnexGetUserResponse fails validation when user has no name set #108

Closed

Description

@warden-nz

Bug

Setting up the Home Assistant integration fails with a pydantic validation error if the Evnex account has no name field populated.

Error

pydantic_core._pydantic_core.ValidationError: 1 validation error for EvnexGetUserResponse

data.name

Field required [type=missing, input_value={'email': '...', 'type': 'User'}, input_type=dict]

Cause

schema/user.py line 14 defines name as a required str, but the Evnex API doesn't return this field if the account has no name set.

Fix

Change line 14 of schema/user.py from:

name: str

to:

name: str | None = None

Environment

  • python-evnex (latest)
  • Home Assistant (HAOS)

Activity

  1. nbmkiwi commented on Jul 3, 2026

    @nbmkiwi

    I also needed to edit /config/custom_components/evnex/config_flow.py and change the line return {"title": user_data.email} to return {"title": user_data.name or user_data.email}.

    That allowed me to install the integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions