Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comply to PEP 0561 #299

Merged
merged 3 commits into from
Jan 5, 2022
Merged

Comply to PEP 0561 #299

merged 3 commits into from
Jan 5, 2022

Conversation

iMicknl
Copy link
Owner

@iMicknl iMicknl commented Jan 5, 2022

No description provided.

@github-actions github-actions bot added the enhancement New feature or request label Jan 5, 2022
Comment on lines +319 to +320
name: str
parameters: list[str | int | float] | None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why I typed this? Or why I added int/float to the list?

I added int/float because we pass that to the API directly from ha-tahoma, and we don't case it to string first.

pyproject.toml Outdated Show resolved Hide resolved
@iMicknl
Copy link
Owner Author

iMicknl commented Jan 5, 2022

homeassistant/components/overkiz/coordinator.py:33: error: Dict entry 5 has incompatible type "DataType": "Callable[[Union[str, bytes], DefaultNamedArg(Optional[Type[JSONDecoder]], 'cls'), DefaultNamedArg(Optional[Callable[[Dict[Any, Any]], Any]], 'object_hook'), DefaultNamedArg(Optional[Callable[[str], Any]], 'parse_float'), DefaultNamedArg(Optional[Callable[[str], Any]], 'parse_int'), DefaultNamedArg(Optional[Callable[[str], Any]], 'parse_constant'), DefaultNamedArg(Optional[Callable[[List[Tuple[Any, Any]]], Any]], 'object_pairs_hook'), KwArg(Any)], Any]"; expected "DataType": "Callable[[DataType], Any]"  [dict-item]
homeassistant/components/overkiz/coordinator.py:34: error: Dict entry 6 has incompatible type "DataType": "Callable[[Union[str, bytes], DefaultNamedArg(Optional[Type[JSONDecoder]], 'cls'), DefaultNamedArg(Optional[Callable[[Dict[Any, Any]], Any]], 'object_hook'), DefaultNamedArg(Optional[Callable[[str], Any]], 'parse_float'), DefaultNamedArg(Optional[Callable[[str], Any]], 'parse_int'), DefaultNamedArg(Optional[Callable[[str], Any]], 'parse_constant'), DefaultNamedArg(Optional[Callable[[List[Tuple[Any, Any]]], Any]], 'object_pairs_hook'), KwArg(Any)], Any]"; expected "DataType": "Callable[[DataType], Any]"  [dict-item]
homeassistant/components/overkiz/coordinator.py:137: error: Item "None" of "Optional[State]" has no attribute "value"  [union-attr]
homeassistant/components/overkiz/coordinator.py:174: error: Argument 1 has incompatible type "Union[None, float, str]"; expected "DataType"  [arg-type]
homeassistant/components/overkiz/executor.py:29: error: Returning Any from function declared to return "Device"  [no-any-return]
homeassistant/components/overkiz/scene.py:28: error: Argument 1 to "OverkizScene" has incompatible type "Union[Device, Scenario]"; expected "Scenario"  [arg-type]
homeassistant/components/overkiz/entity.py:39: error: Returning Any from function declared to return "Device"  [no-any-return]
homeassistant/components/overkiz/sensor.py:403: error: Argument 1 has incompatible type "Union[None, float, str]"; expected "Union[str, int, float]"  [arg-type]
homeassistant/components/overkiz/lock.py:28: error: Item "Scenario" of "Union[Device, Scenario]" has no attribute "device_url"  [union-attr]
homeassistant/components/overkiz/light.py:36: error: Item "Scenario" of "Union[Device, Scenario]" has no attribute "device_url"  [union-attr]
homeassistant/components/overkiz/binary_sensor.py:148: error: Argument 1 has incompatible type "Union[None, float, str]"; expected "str"  [arg-type]
Found 11 errors in 8 files (checked 13 source files)

yay... after pip install git+https://github.com/iMicknl/python-overkiz-api.git@enhancement/further_improve_typing#pyoverkiz==1.0.1.1

and with pyoverkiz 1.0.1

Success: no issues found in 13 source files

@iMicknl iMicknl merged commit 7e5a764 into main Jan 5, 2022
@iMicknl iMicknl deleted the enhancement/further_improve_typing branch January 5, 2022 15:07
tetienne pushed a commit that referenced this pull request Feb 14, 2023
* Add py.typed file

* Improve command typing

* Remove include
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants