Adjust `source` return value, to return `wifi` when `media_app_name` is `AirPlay` or `Spotify`
This commit is contained in:
		
							parent
							
								
									d42e1b2832
								
							
						
					
					
						commit
						735fd53644
					
				|  | @ -10,6 +10,7 @@ | ||||||
| 
 | 
 | ||||||
| - Change "magic numbers" to `MediaPlayerEntityFeature` object | - Change "magic numbers" to `MediaPlayerEntityFeature` object | ||||||
|   For more information see https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation |   For more information see https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation | ||||||
|  | - the `source` now returns the value `wifi` when the `media_app_name` is `AirPlay` or `Spotify` | ||||||
| 
 | 
 | ||||||
| ## [0.2.1] Chore: Format repository - 2024-02-08 | ## [0.2.1] Chore: Format repository - 2024-02-08 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -242,6 +242,8 @@ class SoundbarDevice: | ||||||
| 
 | 
 | ||||||
|     @property |     @property | ||||||
|     def input_source(self): |     def input_source(self): | ||||||
|  |         if self.media_app_name in ("AirPlay", "Spotify"): | ||||||
|  |             return "wifi" | ||||||
|         return self.device.status.input_source |         return self.device.status.input_source | ||||||
| 
 | 
 | ||||||
|     @property |     @property | ||||||
|  |  | ||||||
|  | @ -3,7 +3,8 @@ from typing import Any, Mapping | ||||||
| 
 | 
 | ||||||
| from homeassistant.components.media_player import (DEVICE_CLASS_SPEAKER, | from homeassistant.components.media_player import (DEVICE_CLASS_SPEAKER, | ||||||
|                                                    MediaPlayerEntity) |                                                    MediaPlayerEntity) | ||||||
| from homeassistant.components.media_player.const import MediaPlayerEntityFeature | from homeassistant.components.media_player.const import \ | ||||||
|  |     MediaPlayerEntityFeature | ||||||
| from homeassistant.helpers.aiohttp_client import async_get_clientsession | from homeassistant.helpers.aiohttp_client import async_get_clientsession | ||||||
| from homeassistant.helpers.entity import DeviceInfo, generate_entity_id | from homeassistant.helpers.entity import DeviceInfo, generate_entity_id | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue