Skip to content

Commit

Permalink
fix: order of commands
Browse files Browse the repository at this point in the history
  • Loading branch information
martonborzak committed Jul 15, 2023
1 parent 3ec32ab commit 51b1303
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions driver.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"driver_id": "uc_appletv_driver",
"version": "0.5.0",
"version": "0.5.1",
"min_core_api": "0.7.0",
"name": { "en": "Apple TV" },
"icon": "custom:appletv.png",
Expand Down Expand Up @@ -37,5 +37,5 @@
}
]
},
"release_date": "2023-07-04"
"release_date": "2023-07-15"
}
6 changes: 4 additions & 2 deletions driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ async def onError(message):
'credentials': pairingAppleTv.getCredentials()
})
await storeCofig()
await api.driverSetupComplete(websocket)

entity = entities.media_player.MediaPlayer(pairingAppleTv.identifier, pairingAppleTv.name, [
entities.media_player.FEATURES.ON_OFF,
Expand Down Expand Up @@ -184,6 +183,8 @@ async def onError(message):
entities.media_player.ATTRIBUTES.MEDIA_ALBUM: ""
})
api.availableEntities.addEntity(entity)

await api.driverSetupComplete(websocket)

# We pair with airplay first
elif "pin_airplay" in data:
Expand Down Expand Up @@ -391,7 +392,6 @@ async def main():
global config
global configuredAppleTvs

await api.init('driver.json')
dataPath = api.configDirPath

res = await loadConfig()
Expand Down Expand Up @@ -430,6 +430,8 @@ async def main():
else:
LOG.error("Cannot load config")

await api.init('driver.json')

if __name__ == "__main__":
LOOP.run_until_complete(main())
LOOP.run_forever()

0 comments on commit 51b1303

Please sign in to comment.