summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-31 04:18:52 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-31 04:18:52 +0000
commit4feab366865ad1787d25a77736102f16449e7244 (patch)
tree42719941249d8c4a1ee8a1a6a4f7304f0e18222c
parentf5a75dd1d1881fe0826566247d8f2962e51286dc (diff)
automatic import of python-openhomedevice
-rw-r--r--.gitignore1
-rw-r--r--python-openhomedevice.spec576
-rw-r--r--sources1
3 files changed, 578 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..1bcaa34 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/openhomedevice-2.0.2.tar.gz
diff --git a/python-openhomedevice.spec b/python-openhomedevice.spec
new file mode 100644
index 0000000..ea66a04
--- /dev/null
+++ b/python-openhomedevice.spec
@@ -0,0 +1,576 @@
+%global _empty_manifest_terminate_build 0
+Name: python-openhomedevice
+Version: 2.0.2
+Release: 1
+Summary: Provides an API for requesting information from an Openhome device
+License: MIT License
+URL: https://github.com/bazwilliams/openhomedevice
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/bc/33/fee4069ed32fc6b1a4f552710ae401af8f9c5ca602bedbd5a621827b7dce/openhomedevice-2.0.2.tar.gz
+BuildArch: noarch
+
+
+%description
+# openhomedevice
+
+Library to provide an API to an existing openhome device. The device needs to have been discovered first by something like netdisco (https://github.com/home-assistant/netdisco).
+
+The underlying UPnP client library used is https://github.com/StevenLooman/async_upnp_client
+
+* Tested against [Linn Products Ltd](https://www.linn.co.uk/uk/) devices running Davaar 80 (thought expected to work on earlier variants)
+* Tested against [OpenHome Player](http://openhome.org/) devices
+
+## Installation
+
+`pip install openhomedevice`
+
+## API
+
+### Constructor
+
+```python
+device = Device(location)
+await device.init()
+```
+
+### Methods
+
+#### Control
+
+```python
+ await set_standby(standbyRequested) #bool
+ await play() #starts playback
+ await play_media(track_details) #start playing `track_details`
+ await stop() #stops playback
+ await pause() #pauses playback
+ await skip(offset) #positive or negative integer
+ await set_volume(volume_level) #positive number
+ await increase_volume() #increase volume by 1
+ await decrease_volume() #decrease volume by 1
+ await set_mute(muteRequested) #bool
+ await set_source(index) #positive integer (use Sources() for indices)
+ await invoke_pin(index) #positive integer (use Pins() for indices)
+```
+
+#### Informational
+
+```python
+ uuid() #Unique identifier
+ await name() #Name of device
+ await room() #Name of room
+ await is_in_standby() #returns true if in standby
+ await transport_state() #returns one of Stopped, Playing, Paused or Buffering.
+ volume_enabled #property true if the volume service is available
+ await volume_level() #returns the volume setting or None if disabled
+ await is_muted() #returns true if muted or None if disabled
+ await source() #returns the currently connected source as a dictionary
+ await sources() #returns an array of source dictionaries with indices
+ await track_info() #returns a track dictionary
+ await pins() #returns an array of pin dictionaries with indices
+ pins_enabled #property true if the pins service is available
+```
+
+##### Source Response
+
+```python
+{
+ 'type': 'Playlist',
+ 'name': 'Playlist'
+}
+```
+
+##### Sources Response
+
+```python
+[
+ { 'index': 0, 'type': 'Playlist', 'name': 'Playlist' },
+ { 'index': 1, 'type': 'Radio', 'name': 'Radio' },
+ { 'index': 3, 'type': 'Receiver', 'name': 'Songcast' },
+ { 'index': 6, 'type': 'Analog', 'name': 'Front Aux' }
+]
+```
+
+##### Pins Response
+
+```python
+[
+ {'index': 1, 'title': 'Playstation 4', 'artworkUri': 'external:///source?type=Hdmi&systemName=HDMI3'}
+ {'index': 4, 'title': 'Classic FM', 'artworkUri': 'http://cdn-profiles.tunein.com/s8439/images/logoq.png?t=1'}
+ {'index': 6, 'title': 'Chillout Playlist', 'artworkUri': 'http://media/artwork/chillout-playlist.png'}
+]
+```
+
+##### TrackInfo Response
+
+```python
+{
+ "mimeType": "http-get:*:audio/x-flac:DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000",
+ "rating": None,
+ "performer": [
+ "Fahmi Alqhai, Performer - Johann Sebastian Bach, Composer"
+ ],
+ "bitDepth": 16,
+ "channels": 2,
+ "disc": None,
+ "composer": [],
+ "year": 2017,
+ "duration": 460,
+ "author": [],
+ "albumArtist": [],
+ "type": "object.item.audioItem.musicTrack",
+ "narrator": [],
+ "description": None,
+ "conductor": [],
+ "albumArtwork": "http://static.qobuz.com/images/covers/58/20/8424562332058_600.jpg",
+ "track": 2,
+ "tracks": None,
+ "artwork": None,
+ "genre": [
+ "Klassiek"
+ ],
+ "publisher": "Glossa",
+ "albumGenre": [
+ "Klassiek"
+ ],
+ "artist": [
+ "Fahmi Alqhai"
+ ],
+ "bitRate": None,
+ "albumTitle": "The Bach Album",
+ "uri": "http://192.168.0.110:58050/stream/audio/b362f0f7a1ff33b176bcf2adde75af96.flac",
+ "discs": None,
+ "published": None,
+ "title": "Violin Sonata No. 2 in A Minor, BWV 1003 (Arr. for Viola da gamba) : Violin Sonata No. 2 in A Minor, BWV 1003 (Arr. for Viola da gamba): II. Fuga",
+ "sampleRate": 44100
+}
+```
+
+##### Playing A Track
+
+Use this to play a short audio track, a podcast Uri or radio station Uri. The audio will be played using the radio source of the device. The `trackDetails` object should be the same as the one described in the `TrackInfo` section above.
+
+```python
+ trackDetails = {}
+ trackDetails["uri"] = "http://opml.radiotime.com/Tune.ashx?id=s122119"
+ trackDetails["title"] = 'Linn Radio (Eclectic Music)'
+ trackDetails["albumArtwork"] = 'http://cdn-radiotime-logos.tunein.com/s122119q.png'
+
+ openhomeDevice.PlayMedia(trackDetails)
+```
+
+## Example
+
+```python
+python3 demo.py
+```
+
+## Running Tests
+
+```bash
+PYTHONPATH=. pytest ./tests/*
+```
+
+## Uploading Package
+
+Following guide from https://packaging.python.org/tutorials/packaging-projects/
+
+Update version in `setup.py`
+
+```sh
+python3 setup.py sdist
+twine upload dist/*
+```
+
+%package -n python3-openhomedevice
+Summary: Provides an API for requesting information from an Openhome device
+Provides: python-openhomedevice
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-openhomedevice
+# openhomedevice
+
+Library to provide an API to an existing openhome device. The device needs to have been discovered first by something like netdisco (https://github.com/home-assistant/netdisco).
+
+The underlying UPnP client library used is https://github.com/StevenLooman/async_upnp_client
+
+* Tested against [Linn Products Ltd](https://www.linn.co.uk/uk/) devices running Davaar 80 (thought expected to work on earlier variants)
+* Tested against [OpenHome Player](http://openhome.org/) devices
+
+## Installation
+
+`pip install openhomedevice`
+
+## API
+
+### Constructor
+
+```python
+device = Device(location)
+await device.init()
+```
+
+### Methods
+
+#### Control
+
+```python
+ await set_standby(standbyRequested) #bool
+ await play() #starts playback
+ await play_media(track_details) #start playing `track_details`
+ await stop() #stops playback
+ await pause() #pauses playback
+ await skip(offset) #positive or negative integer
+ await set_volume(volume_level) #positive number
+ await increase_volume() #increase volume by 1
+ await decrease_volume() #decrease volume by 1
+ await set_mute(muteRequested) #bool
+ await set_source(index) #positive integer (use Sources() for indices)
+ await invoke_pin(index) #positive integer (use Pins() for indices)
+```
+
+#### Informational
+
+```python
+ uuid() #Unique identifier
+ await name() #Name of device
+ await room() #Name of room
+ await is_in_standby() #returns true if in standby
+ await transport_state() #returns one of Stopped, Playing, Paused or Buffering.
+ volume_enabled #property true if the volume service is available
+ await volume_level() #returns the volume setting or None if disabled
+ await is_muted() #returns true if muted or None if disabled
+ await source() #returns the currently connected source as a dictionary
+ await sources() #returns an array of source dictionaries with indices
+ await track_info() #returns a track dictionary
+ await pins() #returns an array of pin dictionaries with indices
+ pins_enabled #property true if the pins service is available
+```
+
+##### Source Response
+
+```python
+{
+ 'type': 'Playlist',
+ 'name': 'Playlist'
+}
+```
+
+##### Sources Response
+
+```python
+[
+ { 'index': 0, 'type': 'Playlist', 'name': 'Playlist' },
+ { 'index': 1, 'type': 'Radio', 'name': 'Radio' },
+ { 'index': 3, 'type': 'Receiver', 'name': 'Songcast' },
+ { 'index': 6, 'type': 'Analog', 'name': 'Front Aux' }
+]
+```
+
+##### Pins Response
+
+```python
+[
+ {'index': 1, 'title': 'Playstation 4', 'artworkUri': 'external:///source?type=Hdmi&systemName=HDMI3'}
+ {'index': 4, 'title': 'Classic FM', 'artworkUri': 'http://cdn-profiles.tunein.com/s8439/images/logoq.png?t=1'}
+ {'index': 6, 'title': 'Chillout Playlist', 'artworkUri': 'http://media/artwork/chillout-playlist.png'}
+]
+```
+
+##### TrackInfo Response
+
+```python
+{
+ "mimeType": "http-get:*:audio/x-flac:DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000",
+ "rating": None,
+ "performer": [
+ "Fahmi Alqhai, Performer - Johann Sebastian Bach, Composer"
+ ],
+ "bitDepth": 16,
+ "channels": 2,
+ "disc": None,
+ "composer": [],
+ "year": 2017,
+ "duration": 460,
+ "author": [],
+ "albumArtist": [],
+ "type": "object.item.audioItem.musicTrack",
+ "narrator": [],
+ "description": None,
+ "conductor": [],
+ "albumArtwork": "http://static.qobuz.com/images/covers/58/20/8424562332058_600.jpg",
+ "track": 2,
+ "tracks": None,
+ "artwork": None,
+ "genre": [
+ "Klassiek"
+ ],
+ "publisher": "Glossa",
+ "albumGenre": [
+ "Klassiek"
+ ],
+ "artist": [
+ "Fahmi Alqhai"
+ ],
+ "bitRate": None,
+ "albumTitle": "The Bach Album",
+ "uri": "http://192.168.0.110:58050/stream/audio/b362f0f7a1ff33b176bcf2adde75af96.flac",
+ "discs": None,
+ "published": None,
+ "title": "Violin Sonata No. 2 in A Minor, BWV 1003 (Arr. for Viola da gamba) : Violin Sonata No. 2 in A Minor, BWV 1003 (Arr. for Viola da gamba): II. Fuga",
+ "sampleRate": 44100
+}
+```
+
+##### Playing A Track
+
+Use this to play a short audio track, a podcast Uri or radio station Uri. The audio will be played using the radio source of the device. The `trackDetails` object should be the same as the one described in the `TrackInfo` section above.
+
+```python
+ trackDetails = {}
+ trackDetails["uri"] = "http://opml.radiotime.com/Tune.ashx?id=s122119"
+ trackDetails["title"] = 'Linn Radio (Eclectic Music)'
+ trackDetails["albumArtwork"] = 'http://cdn-radiotime-logos.tunein.com/s122119q.png'
+
+ openhomeDevice.PlayMedia(trackDetails)
+```
+
+## Example
+
+```python
+python3 demo.py
+```
+
+## Running Tests
+
+```bash
+PYTHONPATH=. pytest ./tests/*
+```
+
+## Uploading Package
+
+Following guide from https://packaging.python.org/tutorials/packaging-projects/
+
+Update version in `setup.py`
+
+```sh
+python3 setup.py sdist
+twine upload dist/*
+```
+
+%package help
+Summary: Development documents and examples for openhomedevice
+Provides: python3-openhomedevice-doc
+%description help
+# openhomedevice
+
+Library to provide an API to an existing openhome device. The device needs to have been discovered first by something like netdisco (https://github.com/home-assistant/netdisco).
+
+The underlying UPnP client library used is https://github.com/StevenLooman/async_upnp_client
+
+* Tested against [Linn Products Ltd](https://www.linn.co.uk/uk/) devices running Davaar 80 (thought expected to work on earlier variants)
+* Tested against [OpenHome Player](http://openhome.org/) devices
+
+## Installation
+
+`pip install openhomedevice`
+
+## API
+
+### Constructor
+
+```python
+device = Device(location)
+await device.init()
+```
+
+### Methods
+
+#### Control
+
+```python
+ await set_standby(standbyRequested) #bool
+ await play() #starts playback
+ await play_media(track_details) #start playing `track_details`
+ await stop() #stops playback
+ await pause() #pauses playback
+ await skip(offset) #positive or negative integer
+ await set_volume(volume_level) #positive number
+ await increase_volume() #increase volume by 1
+ await decrease_volume() #decrease volume by 1
+ await set_mute(muteRequested) #bool
+ await set_source(index) #positive integer (use Sources() for indices)
+ await invoke_pin(index) #positive integer (use Pins() for indices)
+```
+
+#### Informational
+
+```python
+ uuid() #Unique identifier
+ await name() #Name of device
+ await room() #Name of room
+ await is_in_standby() #returns true if in standby
+ await transport_state() #returns one of Stopped, Playing, Paused or Buffering.
+ volume_enabled #property true if the volume service is available
+ await volume_level() #returns the volume setting or None if disabled
+ await is_muted() #returns true if muted or None if disabled
+ await source() #returns the currently connected source as a dictionary
+ await sources() #returns an array of source dictionaries with indices
+ await track_info() #returns a track dictionary
+ await pins() #returns an array of pin dictionaries with indices
+ pins_enabled #property true if the pins service is available
+```
+
+##### Source Response
+
+```python
+{
+ 'type': 'Playlist',
+ 'name': 'Playlist'
+}
+```
+
+##### Sources Response
+
+```python
+[
+ { 'index': 0, 'type': 'Playlist', 'name': 'Playlist' },
+ { 'index': 1, 'type': 'Radio', 'name': 'Radio' },
+ { 'index': 3, 'type': 'Receiver', 'name': 'Songcast' },
+ { 'index': 6, 'type': 'Analog', 'name': 'Front Aux' }
+]
+```
+
+##### Pins Response
+
+```python
+[
+ {'index': 1, 'title': 'Playstation 4', 'artworkUri': 'external:///source?type=Hdmi&systemName=HDMI3'}
+ {'index': 4, 'title': 'Classic FM', 'artworkUri': 'http://cdn-profiles.tunein.com/s8439/images/logoq.png?t=1'}
+ {'index': 6, 'title': 'Chillout Playlist', 'artworkUri': 'http://media/artwork/chillout-playlist.png'}
+]
+```
+
+##### TrackInfo Response
+
+```python
+{
+ "mimeType": "http-get:*:audio/x-flac:DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000",
+ "rating": None,
+ "performer": [
+ "Fahmi Alqhai, Performer - Johann Sebastian Bach, Composer"
+ ],
+ "bitDepth": 16,
+ "channels": 2,
+ "disc": None,
+ "composer": [],
+ "year": 2017,
+ "duration": 460,
+ "author": [],
+ "albumArtist": [],
+ "type": "object.item.audioItem.musicTrack",
+ "narrator": [],
+ "description": None,
+ "conductor": [],
+ "albumArtwork": "http://static.qobuz.com/images/covers/58/20/8424562332058_600.jpg",
+ "track": 2,
+ "tracks": None,
+ "artwork": None,
+ "genre": [
+ "Klassiek"
+ ],
+ "publisher": "Glossa",
+ "albumGenre": [
+ "Klassiek"
+ ],
+ "artist": [
+ "Fahmi Alqhai"
+ ],
+ "bitRate": None,
+ "albumTitle": "The Bach Album",
+ "uri": "http://192.168.0.110:58050/stream/audio/b362f0f7a1ff33b176bcf2adde75af96.flac",
+ "discs": None,
+ "published": None,
+ "title": "Violin Sonata No. 2 in A Minor, BWV 1003 (Arr. for Viola da gamba) : Violin Sonata No. 2 in A Minor, BWV 1003 (Arr. for Viola da gamba): II. Fuga",
+ "sampleRate": 44100
+}
+```
+
+##### Playing A Track
+
+Use this to play a short audio track, a podcast Uri or radio station Uri. The audio will be played using the radio source of the device. The `trackDetails` object should be the same as the one described in the `TrackInfo` section above.
+
+```python
+ trackDetails = {}
+ trackDetails["uri"] = "http://opml.radiotime.com/Tune.ashx?id=s122119"
+ trackDetails["title"] = 'Linn Radio (Eclectic Music)'
+ trackDetails["albumArtwork"] = 'http://cdn-radiotime-logos.tunein.com/s122119q.png'
+
+ openhomeDevice.PlayMedia(trackDetails)
+```
+
+## Example
+
+```python
+python3 demo.py
+```
+
+## Running Tests
+
+```bash
+PYTHONPATH=. pytest ./tests/*
+```
+
+## Uploading Package
+
+Following guide from https://packaging.python.org/tutorials/packaging-projects/
+
+Update version in `setup.py`
+
+```sh
+python3 setup.py sdist
+twine upload dist/*
+```
+
+%prep
+%autosetup -n openhomedevice-2.0.2
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-openhomedevice -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 2.0.2-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..d82991d
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+8a53edc2e6b3cb0910c6abfd11b618f5 openhomedevice-2.0.2.tar.gz