Fix anti-windup blocking and pyright/left errors#16
Merged
Conversation
- Move all TYPE_CHECKING blocks after regular imports (fixes Pylint C0413) - Remove unused 'Any' imports where not needed - Create TypedDict for configuration dictionaries (AdapterConfigDict, EffektGuardConfigDict) - Fix implicit string concatenation in weather_adapter - Add entity_registry import to config_flow.py top-level - Remove inline datetime.timedelta imports (use top-level import) - Replace SensorEntityDescription inheritance with composition to avoid Pylance false positives - Configure Pylance to suppress known HA type stub issues in .vscode/settings.json - Add pylint line-too-long ignore configuration All 1107 tests passing.
- Fix EntityCategory import (from homeassistant.const) - Fix ClimateEntityFeature and HVACMode imports (from climate.const) - Add CoordinatorEntity generic type parameter for proper typing - Add explicit coordinator attribute annotations - Add sync method stubs for ClimateEntity abstract methods - Replace pass with raise NotImplementedError in abstract methods - Fix datetime handling in native_value property - Add null checks for config_entry.data access - Use public power_sensor_entity property instead of protected member - Use getattr for optional model attributes
- Add force_update attribute to EffektGuardSensorEntityDescription - Add device_class and force_update attributes to EffektGuardSwitchEntityDescription - Fixes AttributeError when Home Assistant base entity classes access these required fields
- Fixes AttributeError when HA tries to substitute name placeholders - Required by Home Assistant 2024.x+ entity naming system
- Revert to proper inheritance from HA base classes (SensorEntityDescription, SwitchEntityDescription) - Remove unnecessary @DataClass decorators (parent classes are already dataclasses) - Fix datetime import (was missing after previous changes) - Fix EntityCategory import (import from homeassistant.const) - Update pyrightconfig.json to suppress false positive type errors from HA metaclass
- Required for kw_only=True to properly extend frozen HA dataclasses - Fixes TypeError: SensorEntityDescription.__init__() got unexpected keyword argument - Runtime works correctly, Pylance errors are false positives from HA metaclass
- Redeclare all parent fields in entity descriptions for Pylance compatibility - Fix UNDEFINED/UndefinedType imports (from homeassistant.helpers.entity) - Remove pyrightconfig.json (not on main branch) - Remove unused 'field' import from dataclasses The parent classes use HA's special FrozenOrThawed metaclass which Pylance can't analyze, so we redeclare all fields explicitly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.