hassio/ingress.py
def validate_session(self, session: str) -> bool:
        """Return True if session valid and make it longer valid."""
        if session not in self.sessions:
            return False
        valid_until = utc_from_timestamp(self.sessions[session])

        # Is still valid?
        if valid_until < utcnow():
            return False

        # Update time
        valid_until = valid_until + timedelta(minutes=15)
        self.sessions[session] = valid_until.timestamp()

        return True
Return True if session valid and make it longer valid.
Return True if session valid and make it longer valid.
Return True if session valid and make it longer valid .
def validate_session(self, session: str) -> bool:
        if session not in self.sessions:
            return False
        valid_until = utc_from_timestamp(self.sessions[session])
        if valid_until < utcnow():
            return False
        valid_until = valid_until + timedelta(minutes=15)
        self.sessions[session] = valid_until.timestamp()
        return True
def validate_session ( self , session : str ) -> bool : if session not in self . sessions : return False valid_until = utc_from_timestamp ( self . sessions [ session ] ) if valid_until < utcnow ( ) : return False valid_until = valid_until + timedelta ( minutes = 15 ) self . sessions [ session ] = valid_until . timestamp ( ) return True
Return True if session valid and make it longer valid.
Return True if session valid and make it longer valid .
"""Return True if session valid and make it longer valid.""" # Is still valid? # Update time
self
session
str