Ps4 remove throttling (#21961)

* Remove throttling

* Correct docstring
This commit is contained in:
ktnrg45 2019-03-14 09:49:57 -07:00 committed by Anders Melchiorsen
parent e480f75d6d
commit ef2e3f607a

View File

@ -2,16 +2,14 @@
Support for PlayStation 4 consoles. Support for PlayStation 4 consoles.
For more details about this platform, please refer to the documentation at For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.ps4/ https://home-assistant.io/components/ps4/
""" """
from datetime import timedelta
import logging import logging
import socket import socket
import voluptuous as vol import voluptuous as vol
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
import homeassistant.util as util
from homeassistant.components.media_player import ( from homeassistant.components.media_player import (
MediaPlayerDevice, ENTITY_IMAGE_URL) MediaPlayerDevice, ENTITY_IMAGE_URL)
from homeassistant.components.media_player.const import ( from homeassistant.components.media_player.const import (
@ -38,9 +36,6 @@ ICON = 'mdi:playstation'
GAMES_FILE = '.ps4-games.json' GAMES_FILE = '.ps4-games.json'
MEDIA_IMAGE_DEFAULT = None MEDIA_IMAGE_DEFAULT = None
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(seconds=10)
COMMANDS = ( COMMANDS = (
'up', 'up',
'down', 'down',
@ -139,7 +134,6 @@ class PS4Device(MediaPlayerDevice):
"""Subscribe PS4 events.""" """Subscribe PS4 events."""
self.hass.data[PS4_DATA].devices.append(self) self.hass.data[PS4_DATA].devices.append(self)
@util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS)
def update(self): def update(self):
"""Retrieve the latest data.""" """Retrieve the latest data."""
try: try: