diff --git a/homeassistant/components/media_player/universal.py b/homeassistant/components/media_player/universal.py index 22137170165..9bf7dff4d4f 100644 --- a/homeassistant/components/media_player/universal.py +++ b/homeassistant/components/media_player/universal.py @@ -171,7 +171,7 @@ class UniversalMediaPlayer(MediaPlayerDevice): def _child_attr(self, attr_name): """ returns the active child's attr """ - active_child = self.active_child_state + active_child = self._child_state return active_child.attributes.get(attr_name) if active_child else None def _call_service(self, service_name, service_data=None, @@ -185,7 +185,7 @@ class UniversalMediaPlayer(MediaPlayerDevice): if service_data is None: service_data = {} - active_child = self.active_child_state + active_child = self._child_state service_data[ATTR_ENTITY_ID] = active_child.entity_id self.hass.services.call(DOMAIN, service_name, service_data, @@ -222,11 +222,6 @@ class UniversalMediaPlayer(MediaPlayerDevice): return self._child_state = None - @property - def active_child_state(self): - """ the state of the active child or none """ - return self._child_state - @property def name(self): """ name of universal player """ @@ -245,7 +240,7 @@ class UniversalMediaPlayer(MediaPlayerDevice): if master_state == STATE_OFF: return STATE_OFF - active_child = self.active_child_state + active_child = self._child_state if active_child: return active_child.state @@ -366,7 +361,7 @@ class UniversalMediaPlayer(MediaPlayerDevice): @property def device_state_attributes(self): """ Extra attributes a device wants to expose. """ - active_child = self.active_child_state + active_child = self._child_state return {ATTR_ACTIVE_CHILD: active_child.entity_id} \ if active_child else {} diff --git a/tests/components/media_player/test_universal.py b/tests/components/media_player/test_universal.py index d9ebc43983f..910ffca2498 100644 --- a/tests/components/media_player/test_universal.py +++ b/tests/components/media_player/test_universal.py @@ -193,25 +193,25 @@ class TestMediaPlayer(unittest.TestCase): ump.entity_id = media_player.ENTITY_ID_FORMAT.format(config['name']) ump.update_state() - self.assertEqual(None, ump.active_child_state) + self.assertEqual(None, ump._child_state) self.mock_mp_1._state = STATE_PLAYING self.mock_mp_1.update_ha_state() ump.update_state() self.assertEqual(self.mock_mp_1.entity_id, - ump.active_child_state.entity_id) + ump._child_state.entity_id) self.mock_mp_2._state = STATE_PLAYING self.mock_mp_2.update_ha_state() ump.update_state() self.assertEqual(self.mock_mp_1.entity_id, - ump.active_child_state.entity_id) + ump._child_state.entity_id) self.mock_mp_1._state = STATE_OFF self.mock_mp_1.update_ha_state() ump.update_state() self.assertEqual(self.mock_mp_2.entity_id, - ump.active_child_state.entity_id) + ump._child_state.entity_id) def test_name(self): """ test name property """