openairplay / airplay2-receiver

AirPlay 2 Receiver - Python implementation
2.13k stars 133 forks source link

fix: set a default value when can't retrieve #39

Closed eliseomartelli closed 3 years ago

eliseomartelli commented 3 years ago

When running

osascript -e "output volume of (get volume settings)"

with an external soundcard connected I get: "missing value" and the receiver doesn't start. This tries to solve this.

eliseomartelli commented 3 years ago

@systemcrash in set volume the string to integer conversion shouldn't be a problem. We could check the exit code of the subprocess to se if it was succesful

systemcrash commented 3 years ago

@systemcrash in set volume the string to integer conversion shouldn't be a problem. We could check the exit code of the subprocess to se if it was succesful

Possibly - although I think this is a simple enough mechanism, that we can check for the string missing value or an int. Then we don't need to handle an exception.