Compare commits
	
		
			13 Commits
		
	
	
		
			main
			...
			feature/co
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 9700063c3b | |
|  | a85e0db582 | |
|  | 221ecf2aa6 | |
|  | 53dc582fe6 | |
|  | 618e89b19f | |
|  | 97ae0615b3 | |
|  | 4839f403e8 | |
|  | c6e96d0754 | |
|  | 64c4b7aa34 | |
|  | 252d3855ca | |
|  | 08e8f2645d | |
|  | 00eccac431 | |
|  | 7216766068 | 
							
								
								
									
										10
									
								
								CHANGELOG.md
								
								
								
								
							
							
						
						
									
										10
									
								
								CHANGELOG.md
								
								
								
								
							|  | @ -1,15 +1,5 @@ | ||||||
| # Changelog | # Changelog | ||||||
| 
 | 
 | ||||||
| ## [0.4.1] Media Mystique: The Great Data Disappearing Act! |  | ||||||
| 
 |  | ||||||
| ### Fixed |  | ||||||
| 
 |  | ||||||
| - Made media data (*track title*, *artist*, *length*) optional to acoomodate soundbars that don't provide this information (🥲) |  | ||||||
| 
 |  | ||||||
| ### Added |  | ||||||
| 
 |  | ||||||
| - Add translations for the english translation file |  | ||||||
| 
 |  | ||||||
| ## [0.4.0] Started with an "ick", but is now packed with new features 💪 | ## [0.4.0] Started with an "ick", but is now packed with new features 💪 | ||||||
| 
 | 
 | ||||||
| > ⚠️ Please read the following carefully: | > ⚠️ Please read the following carefully: | ||||||
|  |  | ||||||
							
								
								
									
										21
									
								
								LICENSE
								
								
								
								
							
							
						
						
									
										21
									
								
								LICENSE
								
								
								
								
							|  | @ -1,21 +0,0 @@ | ||||||
| MIT License |  | ||||||
| 
 |  | ||||||
| Copyright (c) 2024 Samuel Spagl |  | ||||||
| 
 |  | ||||||
| Permission is hereby granted, free of charge, to any person obtaining a copy |  | ||||||
| of this software and associated documentation files (the "Software"), to deal |  | ||||||
| in the Software without restriction, including without limitation the rights |  | ||||||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |  | ||||||
| copies of the Software, and to permit persons to whom the Software is |  | ||||||
| furnished to do so, subject to the following conditions: |  | ||||||
| 
 |  | ||||||
| The above copyright notice and this permission notice shall be included in all |  | ||||||
| copies or substantial portions of the Software. |  | ||||||
| 
 |  | ||||||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |  | ||||||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |  | ||||||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |  | ||||||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |  | ||||||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |  | ||||||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |  | ||||||
| SOFTWARE. |  | ||||||
|  | @ -2,9 +2,6 @@ | ||||||
| 
 | 
 | ||||||
| Welcome to YASSI, the Home Assistant integration designed to bring comprehensive control over your Samsung Soundbar into your smart home ecosystem. | Welcome to YASSI, the Home Assistant integration designed to bring comprehensive control over your Samsung Soundbar into your smart home ecosystem. | ||||||
| 
 | 
 | ||||||
| > [!NOTE] |  | ||||||
| > Please use service calls for setting the attribute of a custom capability instead of the entity. (See #43 for more information) |  | ||||||
| 
 |  | ||||||
| **Table of Contents:** | **Table of Contents:** | ||||||
| <!-- TOC --> | <!-- TOC --> | ||||||
| * [Why YASSI](#why-yassi) | * [Why YASSI](#why-yassi) | ||||||
|  | @ -84,4 +81,4 @@ Contributions are what make the open-source community such an amazing place to l | ||||||
| 
 | 
 | ||||||
| ## General Thanks | ## General Thanks | ||||||
| 
 | 
 | ||||||
| - Like already mentioned, thanks to @PiotrMachowski / @thierryBourbon for the general idea on how to do things. | - Like already mentioned, thanks to @PiotrMachowski / @thierryBourbon for the general idea on how to do things. | ||||||
|  | @ -72,19 +72,18 @@ class SoundbarDevice: | ||||||
|             await self._update_equalizer() |             await self._update_equalizer() | ||||||
| 
 | 
 | ||||||
|     async def _update_media(self): |     async def _update_media(self): | ||||||
|         if "audioTrackData" in self.device.status._attributes: |         self.__media_artist = self.device.status._attributes["audioTrackData"].value[ | ||||||
|             self.__media_artist = self.device.status._attributes["audioTrackData"].value[ |             "artist" | ||||||
|                 "artist" |         ] | ||||||
|             ] |         self.__media_title = self.device.status._attributes["audioTrackData"].value[ | ||||||
|             self.__media_title = self.device.status._attributes["audioTrackData"].value[ |             "title" | ||||||
|                 "title" |         ] | ||||||
|             ] |         if self.__media_title != self.__old_media_title: | ||||||
|             if self.__media_title != self.__old_media_title: |             self.__old_media_title = self.__media_title | ||||||
|                 self.__old_media_title = self.__media_title |             self.__media_cover_url_update_time = datetime.datetime.now() | ||||||
|                 self.__media_cover_url_update_time = datetime.datetime.now() |             self.__media_cover_url = await self.get_song_title_artwork( | ||||||
|                 self.__media_cover_url = await self.get_song_title_artwork( |                 self.__media_artist, self.__media_title | ||||||
|                     self.__media_artist, self.__media_title |             ) | ||||||
|                 ) |  | ||||||
| 
 | 
 | ||||||
|     async def _update_soundmode(self): |     async def _update_soundmode(self): | ||||||
|         await self.update_execution_data(["/sec/networkaudio/soundmode"]) |         await self.update_execution_data(["/sec/networkaudio/soundmode"]) | ||||||
|  | @ -373,15 +372,11 @@ class SoundbarDevice: | ||||||
| 
 | 
 | ||||||
|     @property |     @property | ||||||
|     def media_duration(self) -> int | None: |     def media_duration(self) -> int | None: | ||||||
|         attr = self.device.status.attributes.get("totalTime", None) |         return self.device.status.attributes.get("totalTime").value | ||||||
|         if attr: |  | ||||||
|             return attr.value |  | ||||||
| 
 | 
 | ||||||
|     @property |     @property | ||||||
|     def media_position(self) -> int | None: |     def media_position(self) -> int | None: | ||||||
|         attr = self.device.status.attributes.get("elapsedTime", None) |         return self.device.status.attributes.get("elapsedTime").value | ||||||
|         if attr: |  | ||||||
|             return attr.value |  | ||||||
| 
 | 
 | ||||||
|     async def media_play(self): |     async def media_play(self): | ||||||
|         await self.device.play(True) |         await self.device.play(True) | ||||||
|  |  | ||||||
|  | @ -1,16 +1,12 @@ | ||||||
| { | { | ||||||
|   "domain": "samsung_soundbar", |   "domain": "samsung_soundbar", | ||||||
|   "name": "Samsung Soundbar", |   "name": "Samsung Soundbar", | ||||||
|   "codeowners": [ |   "codeowners": ["@samuelspagl"], | ||||||
|     "@samuelspagl" |  | ||||||
|   ], |  | ||||||
|   "config_flow": true, |   "config_flow": true, | ||||||
|   "documentation": "https://www.example.com", |   "documentation": "https://www.example.com", | ||||||
|   "integration_type": "hub", |   "integration_type": "hub", | ||||||
|   "iot_class": "cloud_polling", |   "iot_class": "cloud_polling", | ||||||
|   "issue_tracker": "https://github.com/samuelspagl/ha_samsung_soundbar/issues", |   "issue_tracker": "https://github.com/samuelspagl/ha_samsung_soundbar/issues", | ||||||
|   "requirements": [ |   "requirements": ["pysmartthings"], | ||||||
|     "pysmartthings==0.7.8" |   "version": "0.4.0" | ||||||
|   ], | } | ||||||
|   "version": "0.4.1" |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  | @ -107,27 +107,11 @@ | ||||||
|     }, |     }, | ||||||
|     "set_speaker_level":{ |     "set_speaker_level":{ | ||||||
|         "name": "Lautsprecher level verändern", |         "name": "Lautsprecher level verändern", | ||||||
|         "description": "Verändere die Lautstärke der einzelnen Lautsprecher", |         "description": "Verändere die Lautstärke der einzelnen Lautsprecher" | ||||||
|         "fields":{ |  | ||||||
|                 "speaker_identifier": { |  | ||||||
|                     "name": "Lautsprecher", |  | ||||||
|                     "description": "Auszuwählender Lautsprecher" |  | ||||||
|                 }, |  | ||||||
|                 "level": { |  | ||||||
|                     "name": "Lautstärke Level", |  | ||||||
|                     "description": "Lautstärke Level zwischen -6 und 6." |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|     }, |     }, | ||||||
|     "set_rear_speaker_mode":{ |     "set_rear_speaker_mode":{ | ||||||
|         "name": "Modus der hinteren Lautsprecher setzen", |         "name": "Modus der hinteren Lautsprecher setzen", | ||||||
|         "description": "Nutze deine Rücklautsprecher, als 'Vorder-' oder 'Rücklautsprecher'.", |         "description": "Nutze deine Rücklautsprecher, als 'Vorder-' oder 'Rücklautsprecher'." | ||||||
|         "fields":{ |  | ||||||
|                 "speaker_mode": { |  | ||||||
|                     "name": "Lautsprecher Modus", |  | ||||||
|                     "description": "Nutze den Lautsprecher als Front oder Rear Speaker." |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|     }, |     }, | ||||||
|     "set_active_voice_amplifier":{ |     "set_active_voice_amplifier":{ | ||||||
|         "name": "Stimmenverstärker setzen", |         "name": "Stimmenverstärker setzen", | ||||||
|  |  | ||||||
|  | @ -1,18 +1,18 @@ | ||||||
| { | { | ||||||
|     "config": { |     "config":{ | ||||||
|         "step": { |         "step":{ | ||||||
|             "user": { |             "user":{ | ||||||
|                 "data": { |                 "data": { | ||||||
|                     "api_key": "SmartThings API Token", |                     "api_key": "SmartThings API Token", | ||||||
|                     "device_id": "Device ID", |                     "device_id": "Device ID", | ||||||
|                     "device_name": "Device Name", |                     "device_name":"Device Name", | ||||||
|                     "device_volume": "Max Volume (int)" |                     "device_volume": "Max Volume (int)" | ||||||
|                 }, |                   }, | ||||||
|                 "description": "Please enter your credentials.", |                   "description": "Please enter your credentials.", | ||||||
|                 "title": "Authentication" |                   "title": "Authentication" | ||||||
|             }, |             }, | ||||||
|             "device": { |             "device":{ | ||||||
|                 "data": { |                 "data" : { | ||||||
|                     "settings_advanced_audio": "Enable 'Advanced Audio switches' capabilities (NightMode, BassMode, VoiceEnhancer)", |                     "settings_advanced_audio": "Enable 'Advanced Audio switches' capabilities (NightMode, BassMode, VoiceEnhancer)", | ||||||
|                     "settings_eq": "Enable 'EQ selector' capabilities", |                     "settings_eq": "Enable 'EQ selector' capabilities", | ||||||
|                     "settings_soundmode": "Enable 'Soundmode selector' capabilities", |                     "settings_soundmode": "Enable 'Soundmode selector' capabilities", | ||||||
|  | @ -21,8 +21,8 @@ | ||||||
|                 "description": "Some soundbars have a different featureset than others. Please the features supported by your soundbar (visible in the SmartThings App).", |                 "description": "Some soundbars have a different featureset than others. Please the features supported by your soundbar (visible in the SmartThings App).", | ||||||
|                 "title": "Device Settings" |                 "title": "Device Settings" | ||||||
|             }, |             }, | ||||||
|             "reconfigure_confirm": { |             "reconfigure_confirm":{ | ||||||
|                 "data": { |                 "data" : { | ||||||
|                     "settings_advanced_audio": "Enable 'Advanced Audio switches' capabilities (NightMode, BassMode, VoiceEnhancer)", |                     "settings_advanced_audio": "Enable 'Advanced Audio switches' capabilities (NightMode, BassMode, VoiceEnhancer)", | ||||||
|                     "settings_eq": "Enable 'EQ selector' capabilities", |                     "settings_eq": "Enable 'EQ selector' capabilities", | ||||||
|                     "settings_soundmode": "Enable 'Soundmode selector' capabilities", |                     "settings_soundmode": "Enable 'Soundmode selector' capabilities", | ||||||
|  | @ -59,95 +59,5 @@ | ||||||
|                 "Front": "Front" |                 "Front": "Front" | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     }, |   } | ||||||
|     "services": { |  | ||||||
|         "select_soundmode": { |  | ||||||
|             "name": "Select Sound Mode", |  | ||||||
|             "description": "Choose between 'Standard', 'Surround', 'Game', and 'Adaptive Sound'." |  | ||||||
|         }, |  | ||||||
|         "set_woofer_level": { |  | ||||||
|             "name": "Set Subwoofer Level", |  | ||||||
|             "description": "Change the volume of your subwoofer.", |  | ||||||
|             "fields": { |  | ||||||
|                 "level": { |  | ||||||
|                     "name": "Volume Level", |  | ||||||
|                     "description": "Subwoofer level, from -12 to +6" |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         }, |  | ||||||
|         "set_night_mode": { |  | ||||||
|             "name": "Set Night Mode", |  | ||||||
|             "description": "Turn 'Night Mode' on/off.", |  | ||||||
|             "fields": { |  | ||||||
|                 "enabled": { |  | ||||||
|                     "name": "On/Off", |  | ||||||
|                     "description": "See name." |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         }, |  | ||||||
|         "set_bass_enhancer": { |  | ||||||
|             "name": "Set Bass Mode", |  | ||||||
|             "description": "Turn 'Bass Mode' on/off.", |  | ||||||
|             "fields": { |  | ||||||
|                 "enabled": { |  | ||||||
|                     "name": "On/Off", |  | ||||||
|                     "description": "See name." |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         }, |  | ||||||
|         "set_voice_enhancer": { |  | ||||||
|             "name": "Set Voice Enhancer", |  | ||||||
|             "description": "Turn 'Voice Enhancer' on/off.", |  | ||||||
|             "fields": { |  | ||||||
|                 "enabled": { |  | ||||||
|                     "name": "On/Off", |  | ||||||
|                     "description": "See name." |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         }, |  | ||||||
|         "set_speaker_level": { |  | ||||||
|             "name": "Change Speaker Level", |  | ||||||
|             "description": "Change the volume of individual speakers.", |  | ||||||
|             "fields":{ |  | ||||||
|                 "speaker_identifier": { |  | ||||||
|                     "name": "Speaker Identifier", |  | ||||||
|                     "description": "Identifier of the speaker." |  | ||||||
|                 }, |  | ||||||
|                 "level": { |  | ||||||
|                     "name": "Level", |  | ||||||
|                     "description": "Level of the Speaker from -6 to 6." |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         }, |  | ||||||
|         "set_rear_speaker_mode": { |  | ||||||
|             "name": "Set Rear Speaker Mode", |  | ||||||
|             "description": "Use your rear speakers as 'Front' or 'Rear' speakers.", |  | ||||||
|             "fields":{ |  | ||||||
|                 "speaker_mode": { |  | ||||||
|                     "name": "Speaker mode", |  | ||||||
|                     "description": "Weather the speaker are used as rear / front speakers." |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         }, |  | ||||||
|         "set_active_voice_amplifier": { |  | ||||||
|             "name": "Set Voice Amplifier", |  | ||||||
|             "description": "Turn 'Voice Amplifier' on/off.", |  | ||||||
|             "fields": { |  | ||||||
|                 "enabled": { |  | ||||||
|                     "name": "On/Off", |  | ||||||
|                     "description": "See name." |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         }, |  | ||||||
|         "set_space_fit_sound": { |  | ||||||
|             "name": "Set SpaceFitSound", |  | ||||||
|             "description": "Turn 'SpaceFitSound' on/off.", |  | ||||||
|             "fields": { |  | ||||||
|                 "enabled": { |  | ||||||
|                     "name": "On/Off", |  | ||||||
|                     "description": "See name." |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| } | } | ||||||
		Loading…
	
		Reference in New Issue