Skip to content

Commit

Permalink
Update ZpService.js
Browse files Browse the repository at this point in the history
TV inputs `AirPlay`, `Audio In`, and `TV In` to work on zone rather than on zone group, see #1.
  • Loading branch information
ebaauw committed Sep 6, 2019
1 parent 2663958 commit 2d6a63c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/ZpService.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,20 +805,21 @@ class Tv extends ZpService {
if (value === 1 && source.uri == null) {
await this.zpClient.becomeCoordinatorOfStandaloneGroup()
} else if (source.uri != null) {
this.zpMaster.coordinator.sonosService.awaitAvTransportEvent = true
const zp = value <= 4 ? this.zpMaster : this.zpMaster.coordinator
zp.sonosService.awaitAvTransportEvent = true
if (source.container) {
await this.zpMaster.coordinator.zpClient.setAvTransportQueue(
await zp.zpClient.setAvTransportQueue(
source.uri, source.meta
)
} else {
await this.zpMaster.coordinator.zpClient.setAvTransportUri(
await zp.zpClient.setAvTransportUri(
source.uri, source.meta
)
}
await events.once(
this.zpMaster.coordinator.sonosService, 'AVTransportEvent'
zp.sonosService, 'AVTransportEvent'
)
await this.zpMaster.coordinator.zpClient.play()
await zp.zpClient.play()
}
} catch (error) {
this.error(error)
Expand Down

0 comments on commit 2d6a63c

Please sign in to comment.