Skip to content

Invalid method id(api_id).is_connected(bool) #6410

@Arman-GeDon

Description

@Arman-GeDon

Feedback

Esphome 2026.3.3
The documentation says that to check if a client subscribed to entity states is connected (typically Home Assistant), you should use the lambda method: id(api_id).is_connected(true).
However, during compilation, there's an error that the is_connected method doesn't expect any parameters.

Reviewing the API documentation, the correct method is id(api_id).is_connected_with_state_subscription()
https://api-docs.esphome.io/classesphome_1_1api_1_1_a_p_i_server#a73b1d40e94f8655f20febda1e97a82c6

URL

https://esphome.io/components/api/#apiconnected-condition

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions