Giter Site home page Giter Site logo

Comments (6)

balloob avatar balloob commented on August 15, 2024

is_active_input is a value that is returned by the Chromecast. It is my understanding that it is true when the TV is turned on and tuned into the Chromecast channel.

I have had no problems with it in the past.

The current implementation of is_idle is this:

    @property
    def is_idle(self):
        """ Returns if there is currently an app running. """
        return (self.status is None or not self.status.is_active_input or
                self.app_id in (None, IDLE_APP_ID))

is_active_input is one of the 3 checks to determine if the Chromecast is idle. We check:

  1. If we don't have an active status
  2. If we are not the active input
  3. If there is no app running or the backdrop app is running

I think that we need to do some more research on the reliability of is_active_input. If it really is unstable we can remove the is_idle dependency on it.

from pychromecast.

rmkraus avatar rmkraus commented on August 15, 2024

In my local copy, I've remove the "not self.status.is_active_input" check.
It gives me the expected behavior. On XDA Developers, there appears to be a
handful of people having CEC problems
https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=chromecast+cec+problems+site:forum.xda-developers.com.
It is hard to diagnose this issue specifically as I'm not sure anyone has
really looked into this value all that closely. It appears that it is
likely a firmware issue on my devices.

At either rate, this check for is_active_input is probably not necessary
since, if CEC is properly enabled and the active app is not Background, the
Chromecast should switch the input over automatically anyway. Another
option would be to create a global list in the pychromecast module called
something like DISABLE_CEC that can be populated with friendly names of
devices for which CEC related values should be ignored. It could even use
the fnmatch module https://docs.python.org/3/library/fnmatch.html to
allow for wildcards in friendly names. This feature could then be forwarded
to the Home Assistant config file. Just a thought.

Thanks,

Ryan Kraus

On Mon, Jul 6, 2015 at 4:06 PM, Paulus Schoutsen [email protected]
wrote:

is_active_input is a value that is returned by the Chromecast. It is my
understanding that it is true when the TV is turned on and tuned into the
Chromecast channel.

I have had no problems with it in the past.

The current implementation of is_idle is this:

@property
def is_idle(self):
    """ Returns if there is currently an app running. """
    return (self.status is None or not self.status.is_active_input or
            self.app_id in (None, IDLE_APP_ID))

is_active_input is one of the 3 checks to determine if the Chromecast is
idle. We check:

  1. If we don't have an active status
  2. If we are not the active input
  3. If there is no app running or the backdrop app is running

I think that we need to do some more research on the reliability of
is_active_input. If it really is unstable we can remove the is_idle
dependency on it.


Reply to this email directly or view it on GitHub
#50 (comment)
.

from pychromecast.

minektur avatar minektur commented on August 15, 2024

There is the case where you may have started an app, the CC switched input
with CEC, and then you switched manually away via buttons on the TV, the
remote etc...

It would be nice to be able to know this case. I like your idea of having
some kind of quirks setting that has default behavior but lets you
override...

Fred Clift

On Tue, Jul 7, 2015 at 4:26 PM, Ryan Kraus [email protected] wrote:

In my local copy, I've remove the "not self.status.is_active_input" check.
It gives me the expected behavior. On XDA Developers, there appears to be a
handful of people having CEC problems
<
https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=chromecast+cec+problems+site:forum.xda-developers.com

.
It is hard to diagnose this issue specifically as I'm not sure anyone has
really looked into this value all that closely. It appears that it is
likely a firmware issue on my devices.

At either rate, this check for is_active_input is probably not necessary
since, if CEC is properly enabled and the active app is not Background, the
Chromecast should switch the input over automatically anyway. Another
option would be to create a global list in the pychromecast module called
something like DISABLE_CEC that can be populated with friendly names of
devices for which CEC related values should be ignored. It could even use
the fnmatch module https://docs.python.org/3/library/fnmatch.html to
allow for wildcards in friendly names. This feature could then be forwarded
to the Home Assistant config file. Just a thought.

Thanks,

Ryan Kraus

On Mon, Jul 6, 2015 at 4:06 PM, Paulus Schoutsen <[email protected]

wrote:

is_active_input is a value that is returned by the Chromecast. It is my
understanding that it is true when the TV is turned on and tuned into the
Chromecast channel.

I have had no problems with it in the past.

The current implementation of is_idle is this:

@Property
def is_idle(self):
""" Returns if there is currently an app running. """
return (self.status is None or not self.status.is_active_input or
self.app_id in (None, IDLE_APP_ID))

is_active_input is one of the 3 checks to determine if the Chromecast is
idle. We check:

  1. If we don't have an active status
  2. If we are not the active input
  3. If there is no app running or the backdrop app is running

I think that we need to do some more research on the reliability of
is_active_input. If it really is unstable we can remove the is_idle
dependency on it.


Reply to this email directly or view it on GitHub
<
https://github.com/balloob/pychromecast/issues/50#issuecomment-118980297>

.


Reply to this email directly or view it on GitHub
#50 (comment)
.

from pychromecast.

balloob avatar balloob commented on August 15, 2024

So we can choose between:

  1. Keep is_active_input and have it work at some TVs and not work at some other TVs
  2. Remove is_active_input, lose the ability to detect if the Chromecast stream is visible but have consistent behavior.
  3. Go hybrid and do one by default and allow switching to the other if needed.

If we go for 3, which one should be active by default, 1 or 2? I think it would make sense to keep 1 as default because it provides the most comprehensive test.

from pychromecast.

rmkraus avatar rmkraus commented on August 15, 2024

I agree. Simce there is interest in keeping the current functionality, then
a hybrid approach would probably be best. If something changes, keeping the
current behavior as default makes the most sense to me too. If you'd like,
I can put in some PRs to apply these updates. I don't want to distract you
from HA.

On Wednesday, July 8, 2015, Paulus Schoutsen [email protected]
wrote:

So we can choose between:

  1. Keep is_active_input and have it work at some TVs and not work at some
    other TVs
  2. Remove is_active_input, lose the ability to detect if the Chromecast
    stream is visible but have consistent behavior.
  3. Go hybrid and do one by default and allow switching to the other if
    needed.

If we go for 3, which one should be active by default, 1 or 2? I think it
would make sense to keep 1 as default because it provides the most
comprehensive test.


Reply to this email directly or view it on GitHub
#50 (comment)
.

Thanks,

Ryan Kraus

from pychromecast.

rmkraus avatar rmkraus commented on August 15, 2024

Done.

from pychromecast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.