1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Add and corrects typehints in Entity helper & core class (#26805)

* Add and corrects typehints in Entity class

* Adjust state type based on comments
This commit is contained in:
Franck Nijhof
2019-09-24 23:20:04 +02:00
committed by Paulus Schoutsen
parent b1118cb8ff
commit 6f9ccb5434
2 changed files with 18 additions and 18 deletions

View File

@@ -703,7 +703,7 @@ class State:
def __init__(
self,
entity_id: str,
state: Any,
state: str,
attributes: Optional[Dict] = None,
last_changed: Optional[datetime.datetime] = None,
last_updated: Optional[datetime.datetime] = None,
@@ -732,7 +732,7 @@ class State:
)
self.entity_id = entity_id.lower()
self.state: str = state
self.state = state
self.attributes = MappingProxyType(attributes or {})
self.last_updated = last_updated or dt_util.utcnow()
self.last_changed = last_changed or self.last_updated
@@ -924,7 +924,7 @@ class StateMachine:
def set(
self,
entity_id: str,
new_state: Any,
new_state: str,
attributes: Optional[Dict] = None,
force_update: bool = False,
context: Optional[Context] = None,
@@ -950,7 +950,7 @@ class StateMachine:
def async_set(
self,
entity_id: str,
new_state: Any,
new_state: str,
attributes: Optional[Dict] = None,
force_update: bool = False,
context: Optional[Context] = None,