* Fix issue #16606
Some projectors do not respond to pjlink requests during a short period after the status changes or when its in standby, resulting in pypjlink2 throwing an error. This fix catches these errors. Furthermore, only the status 'on' and 'warm-up' is interpreted as switched on, because 'cooling' is actually a switched off status.
* Update pjlink.py
Improved error handling
* Update pjlink.py
Improved error handling
* Update pjlink.py
Clean up
* Include exception details in the error log
I see this error quite often in my HA logs and this will be helpful for anyone who is attempting to debug this.
* Minor change
* Remove line break
* SongPal: error handling if active_source can't be detected
* sonpal: Add comment to the use of getattr() for property source
* songpal: make comment single-line
* Use local_ip from config to discover IGD device
In case of multi-homed server UPNP discovery finds IGD device on some "default" interface. WIth this modification discovery will be performed from 'local_ip'.
* Update device.py
* Changed version of async_upnp_client in requirements
* Used aysnc_upnp_client==0.14.0
* Changed requirement to async_upnp_client==0.14.0.dev0
* Changed requirement to async_upnp_client==0.14.0.dev0
* Changed requirement to async_upnp_client==0.14.0.dev0
* Fixed code style
* Fixed code style
* Changed version of async_upnp_client in requerements
* Changed version of async_upnp_client in requirements
* Regenerated requirements (new async_upnp_client)
* Regenerated requirements (new async_upnp_client)
* Changed requirement to async_upnp_client=0.14.1
* Changed requirement to async_upnp_client=0.14.1
* Updated requirements
* Updated requirements.txt
* Corrected requirements
* Corrected import of DeviceState
* Constants changed according new async_upnp_client
* Upgraded for async_upnp_client==0.14.2
This lane ended up calling vars(transport) on an asyncio Transport
object. In a standard setup, that's a python object provided by syncio,
and it works. Home Assistant injects uvloop into asyncio, which makes this
a Python C object, and those don't support vars().
* fix cla-bot
* fix bug introduced after linter complaint
* merge two components into one
support telnet port configuration
* remove obsolete nadtcp component. nad component must be used instead.
* back to correct nad_receiver version
* Fix shuffle/random status
MPD always shows true for shuffle. For some reason casting the 0 or 1 as a boolean does not work. Now returns 'true' or 'false' based on the value of 'random'.
* Update homeassistant/components/media_player/mpd.py
Change to correct way of returning shuffle boolean. 'random' needs to be cast as an integer before being cast as a boolean.
Co-Authored-By: apetrycki <34962392+apetrycki@users.noreply.github.com>
* Remove incorrect string code
Original fix method returns a string instead of a boolean. Removed in favor of MartinHjelmare's method.
* Disable creating port mappings from UI, add discovery from component
* Remove unused constant
* Upgrade to async_upnp_client==0.13.6 and use manufacturer from device
* Upgrade to async_upnp_client==0.13.7
* Feature: support for the HK AVR
* Remove testcode
* Feature: support for the HK AVR
* Remove testcode
* Added checklist
* Review fixes whitespaces
* Lint fixes
* Review fixes, add current source
* Remove unused imports
* Review fixes; State constants, dict[key]
* More review fixes, Unknown state and Sources
* Review fix; rename devices to entities
* Add websocket-based non-polling variant for songpal
* linting fixes
* changes based on Martin's feedback
* Fix linting
* add backoff timer for reconnects, fix variable naming (I thought that this wouldn't matter for internals..)
* Remove poll configuration variable
* bump the version just to be sure, the previous release lacked a version file (required for setup.py)
* Fix unavailable
Change setting to unavailable when getting request exceptions only after 1 minute has past since 1st occurrence.
* Put common code in _check_state_available
Put common code to determine if available should be set to False in method _check_state_available
* Create test for platform
Created test for platform.
Added media_stop to common.py test
* Multiple improvements
Fixed lint issue in common.py
Fixed lint issues in test_directv.py
Improved patching import using modile_patcher.start() and stop()
Added asserts for service calls.
* Updates based on Martin's review
Updates based on Martin's review.
* Updated test based on PR#18474
Updated test to use service play_media instead of select_source based on change from PR18474
* Lint issues
Lint issues
* Further updates based on feedback
Updates based on feedback provided.
* Using async_load_platform for discovery test
Using async_load_platform for discovery tests.
Added asserts to ensure entities are created with correct names.
* Used HASS event_loop to setup component
Use HASS event_loop to setup the component async.
* Updated to use state machine for # entities
Updated to use state machine to count # entities instead of entities.
* Use hass.loop instead of getting current loop
Small update to use hass.loop instead, thanks Martin!
* Forgot to remove asyncio
Removed asyncio import.
* Added fixtures
Added fixtures.
* Remove not needed updates and assertions
* Return mocked dtv instance from side_effect
* Fix return correct fixture instance
* Clean up assertions
* Fix remaining patches
* Mock time when setting up component in fixture
* Patch time correctly
* Attribute _last_update should return utcnow
* Add support for Mode trait in Google Assistant.
* Simplify supported logic.
* Fix SUPPORTED_MODE_SETTINGS to correct rip failures.
* more stray commas
* update tests.
* Use service play_media instead of select_source
Use service play_media instead of select_source to change the channel as play_media is the right service for that.
* Log error on invalid media type
Log an error instead of raising a NotImplementedError if an invalid media type is provided.
* Changed so that success is not in else statement
Updated so that if media_type is channel that it is not in the else of an if.
* Update directv.py
Removed SELECT_SOURCE as supported feature.
* Rebased
Re-based with dev
* Enhancements for DirecTV media player
Following enhancements have been made:
1. Added debug logging
2. Added ability to change channel using select_source service of the remote platform.
3. State will now show paused if a recorded program is paused, for live TV playing will always be returned.
4. Added the following attributes:
a. media_position: current position of the media (in seconds)
b. media_position_updated_at: timestamp when media_position was updated.
c. source: current source (channel).
d. media_isbeingrecorded: if current media is being recorded or not.
e. media_rating: TV/Movie rating of the media
f. media_recorded: if current media is recorded or live TV
g. media_starttime: Timestamp media was aired
Reordered properties to follow same order as how they are in __init__.py of remote platform.
* Fixed error and cleaned up few items
Fixed an issue when determining if a program is recorded or not.
Cleaned up some coding.
* Added available property
Added available property
* Disable feature TURN_ON and TURN_OFF for DVR clients
Disable the feature turn_on and turn_off for DVR clients.
* self._is_client and raise NotImplementedError
Updated setting self._is_client
Raise NotImplementedError if turn_on or turn_off is called for clients.
* Enable native support + ADB authentication for Fire TV
* Remove unnecessary underscore assignments
* Bump firetv to 1.0.5.3
* Change requirements to 'firetv>=1.0.6'
* Change requirement from 'firetv>=1.0.6' to 'firetv==1.0.6'
* Address pylint errors
* Ran 'python script/gen_requirements_all.py'
* Address some minor reviewer comments
* Run 'python script/gen_requirements_all.py'
* Just use the 'requirements_all.txt' and 'requirements_test_all.txt' from the 'dev' branch...
* Edit the 'requirements_all.txt' file manually
* Pass flake8 tests
* Pass pylint tests, add extended description for 'select_source'
* More precise exception catching
* More Pythonic returns
* Import exceptions inside '__init__'
* Remove 'time.sleep' command
* Sort the imports
* Use 'config[key]' instead of 'config.get(key)'
* Remove accessing of hidden attributes; bump firetv version to 1.0.7
* Bump firetv to 1.0.7 in 'requirements_all.txt'
* Don't access 'self.firetv._adb', use 'self.available' instead
* Remove '_host' and '_adbkey' attributes
* Create the 'FireTV' object in 'setup_platform' and check the connection before instantiating the entity
* Fixed config validation for 'adbkey'
* add_devices -> add_entities
* Remove 'pylint: disable=no-name-in-module'
* Don't assume the device is available after attempting to connect
* Update the state after reconnecting
* Modifications to 'adb_decorator'
* Modifications to 'setup_platform'
* Don't update the state if the ADB reconnect attempt was unsuccessful
* 'return None' -> 'return'
* Use 'threading.Lock()' instead of a boolean for 'adb_lock'
* Use a non-blocking 'threading.Lock'
* Added eco mode option to Ziggo Mediabox XL
* Changed eco_mode_on to eco_mode
* Removed eco_mode option, the player is unavailable when offline
* Timeout on connection, on/off states are handled via update
* Improved state detection and added available property
* Enhancements for DirecTV media player
Following enhancements have been made:
1. Added debug logging
2. Added ability to change channel using select_source service of the remote platform.
3. State will now show paused if a recorded program is paused, for live TV playing will always be returned.
4. Added the following attributes:
a. media_position: current position of the media (in seconds)
b. media_position_updated_at: timestamp when media_position was updated.
c. source: current source (channel).
d. media_isbeingrecorded: if current media is being recorded or not.
e. media_rating: TV/Movie rating of the media
f. media_recorded: if current media is recorded or live TV
g. media_starttime: Timestamp media was aired
Reordered properties to follow same order as how they are in __init__.py of remote platform.
* Fixed error and cleaned up few items
Fixed an issue when determining if a program is recorded or not.
Cleaned up some coding.
* Fix issue in checking if DTV device is already configured
If a DTV device was configured before, then discovery would add this device again seperately if the name specified in the configuration is different from the name on the DTV.
This issue is fixed now. Part of the fix also ensure to allow multiple "primary" devices on the network to be discovered.
Further also added debug logging to the setup_platform.
* Further improvements
Some additional improvements related to handling the DATA_DIRECTV in hass.data.
* Fixed flake8 issue
Fixed flake8 issue
* Added available property
Added available property
* Updated to use get_locations()
Replaced doing the request for getLocations with the get_locations() API from DirectPy instead.
* Fix for checking if device is available
Fix for checking if device is available and small update to debug log message.
* Fixed lint issue
Fixed lint issue with unused variable by adding ingore for it as this is for a enumerate
* Updated try/except and removed available
Updated tr/except having the except by the statement we're doing except on.
Removed available, will be a different PR.
* Updated known_devices to be tupples in a set
Updated known_devices to be a tupple in a set, removing loop to determine if client was already added.
* Enhancements for DirecTV media player
Following enhancements have been made:
1. Added debug logging
2. Added ability to change channel using select_source service of the remote platform.
3. State will now show paused if a recorded program is paused, for live TV playing will always be returned.
4. Added the following attributes:
a. media_position: current position of the media (in seconds)
b. media_position_updated_at: timestamp when media_position was updated.
c. source: current source (channel).
d. media_isbeingrecorded: if current media is being recorded or not.
e. media_rating: TV/Movie rating of the media
f. media_recorded: if current media is recorded or live TV
g. media_starttime: Timestamp media was aired
Reordered properties to follow same order as how they are in __init__.py of remote platform.
* Fixed error and cleaned up few items
Fixed an issue when determining if a program is recorded or not.
Cleaned up some coding.
* Fix issue in checking if DTV device is already configured
If a DTV device was configured before, then discovery would add this device again seperately if the name specified in the configuration is different from the name on the DTV.
This issue is fixed now. Part of the fix also ensure to allow multiple "primary" devices on the network to be discovered.
Further also added debug logging to the setup_platform.
* Further improvements
Some additional improvements related to handling the DATA_DIRECTV in hass.data.
* Fixed flake8 issue
Fixed flake8 issue
* Added available property
Added available property
* Updated to use get_locations()
Replaced doing the request for getLocations with the get_locations() API from DirectPy instead.
* Fix for checking if device is available
Fix for checking if device is available and small update to debug log message.
* Fixed lint issue
Fixed lint issue with unused variable by adding ingore for it as this is for a enumerate
* Updated try/except and removed available
Updated tr/except having the except by the statement we're doing except on.
Removed available, will be a different PR.
* Add available property
Add the available property to the entiry.
* Added service select_video_output and video_out attribute
* Fixed white lines and long lines
* Made line shorter
* Added period to comment according to flake8 rules
* Imported domain const
* Prefixed service with platform name
* changed "video output" to "hdmi output" to better reflect eiscp cammand
* video_output to hdmi_output rename
* Add surround programs to zone 2+
Add surround programs and surround program to any zone that supports it.
* Update yamaha.py
removed double fetching.
* Enhancements for DirecTV media player
Following enhancements have been made:
1. Added debug logging
2. Added ability to change channel using select_source service of the remote platform.
3. State will now show paused if a recorded program is paused, for live TV playing will always be returned.
4. Added the following attributes:
a. media_position: current position of the media (in seconds)
b. media_position_updated_at: timestamp when media_position was updated.
c. source: current source (channel).
d. media_isbeingrecorded: if current media is being recorded or not.
e. media_rating: TV/Movie rating of the media
f. media_recorded: if current media is recorded or live TV
g. media_starttime: Timestamp media was aired
Reordered properties to follow same order as how they are in __init__.py of remote platform.
* Fixed error and cleaned up few items
Fixed an issue when determining if a program is recorded or not.
Cleaned up some coding.
* Attribute last position update only updated when position changed.
The attribute media_position_updated_at will only be updated if the position changed (thus media is playing for recorded or live TV).
Added assumed_state; will be set to False if in standby or when a recorded show is watched. For live TV it will be set to True.
* Added some empty lines for easier reading
Added some empty lines before returns to improve readability.
* Seperated words in constants
Seperated the words in constants.
* Fix _lastupdate to _last_update
Split words in _lastupdate to _last_update as I missed it.
* Add LG soundbar support
We can autodiscover these, so for now let's skip any local configuration.
Currently we expose volume, source and equaliser preset - we can expose the
other volume controls and options as well if necessary, but I don't know
whether it's worth it.
* Add discovery of LG devices
This is a generic discovery type that doesn't obviously contain enough
information to identify whether we're talking to a speaker system or any
other kind of device - on the other hand I haven't been able to find any
other LG devices that respond like this, so we can cross that bridge when
we get to it.
* Lint
* Validate ports as port
Better than just a positive integer since it limits the range from 1 to 65535.
* Validate port for Axis
* Validate port for Xiaomi Home Camera
* Validate port for Modbus
* Validate port for Yamaha MusicCast Receivers
* Update zhong_hong.py
Validate port as a port, the gateway address as positive_int
Also moved the default values to their variable
* Validate port for the Asterisk Voicemail interface
* Fix lint
* Validate port for Xiaomi Cameras
* Add support for sound_mode for Yamaha rxv media_player
* Catch ParseError Exeption on surround_program for unsupported models
* Catch all Exeptions from rxv
* only get sound mode list / current sound mode on main_zone
* increasing python-websockets' version number so now it works with python 3.7
* required version for websockets increased to work with Python 3.7
* script/gen_requirements_all.py is done
* Don't treat typing as an "in-between" module for import order
That was a < 3.5 era thing.
* Tighten scope of some pylint unused-import disables
To avoid isort moving a top level one around, undesirably broadening its
scope.