Skip to content

Entity state not updated if Apple TV device is not connected. #93

@zehnm

Description

@zehnm

Description

The exposed media-player entity doesn't update the state if the Apple TV device is not connected.
This leads to usability issues in the UI.

How to Reproduce

  1. Make sure Apple TV is connected
  2. Send a command, verify if works
  3. Disconnect Apple TV from network or pull power
  4. Check logs that the connection is no longer established
  5. --> entity state does not change to UNAVAILABLE
  6. --> send a command: error 503 (not available)

Expected behavior

If a device is not reachable, all exposed entities must have state UNAVAILABLE.
Otherwise there will be no user notification that a command can't be sent, only an error after trying to send a command.

Integration version

0.20.1

Additional context

The device is clearly not connected, but the entity state is not set to UNAVAILABLE:

driver: Got ### command request: on
driver: Device not connected, reconnect
driver: Device is off, sending turn on command
tv: Command wrapper : not connected try reconnect
ucapi.api: [('127.0.0.1', 57440)] ->: {'kind': 'resp', 'req_id': 28, 'code': 503, 'msg': 'result', 'msg_data': {}}
tv: Find AppleTV for identifier ### and hosts None
tv: [AppleTV Wohnzimmer] Trying to connect again in 30s

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions