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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typecheck Devices #551

Merged
merged 14 commits into from Jan 6, 2021
Merged

Typecheck Devices #551

merged 14 commits into from Jan 6, 2021

Conversation

farmio
Copy link
Member

@farmio farmio commented Jan 4, 2021

Description

Typecheck all Devices, RemoteValueClimate* and some minor annotations here and there

It's getting a little tricky now - especially with ClimateMode. But this seems to be the xknx fig leave anyway 馃槄

The values of RemoteValues are ignored by now - this has to be reverted when RemoteValue and the DPTs are typechecked. eg: Sensor.resolve_state(self) -> Optional[Any] or

Light.current_brightness(self) -> Optional[int]:
        """Return current brightness of light."""
        return self.brightness.value  # type: ignore

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • The documentation has been adjusted accordingly
  • The changes generate no new warnings
  • Tests have been added that prove the fix is effective or that the feature works
  • The changes are documented in the changelog
  • The Homeassistant plugin has been adjusted in case of new config options

@coveralls
Copy link

coveralls commented Jan 4, 2021

Coverage Status

Coverage increased (+0.01%) to 94.872% when pulling ddb5030 on farmio:typecheck-devices into 9514546 on XKNX:master.

@farmio farmio changed the title Typecheck BinarySensor, Climate and ClimateMode Typecheck Devices Jan 5, 2021
@farmio farmio merged commit 4379417 into XKNX:master Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants