Update typing 10 (#48071)

This commit is contained in:
Marc Mueller 2021-03-18 13:07:04 +01:00 committed by GitHub
parent 00dca88024
commit 25a13d1554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 412 additions and 333 deletions

View file

@ -1,7 +1,8 @@
"""A sensor platform that give you information about the next space launch."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Optional
from pylaunches import PyLaunches, PyLaunchesException
import voluptuous as vol
@ -64,7 +65,7 @@ class LaunchLibrarySensor(Entity):
return self._name
@property
def state(self) -> Optional[str]:
def state(self) -> str | None:
"""Return the state of the sensor."""
if self.next_launch:
return self.next_launch.name
@ -76,7 +77,7 @@ class LaunchLibrarySensor(Entity):
return "mdi:rocket"
@property
def extra_state_attributes(self) -> Optional[dict]:
def extra_state_attributes(self) -> dict | None:
"""Return attributes for the sensor."""
if self.next_launch:
return {