Repository navigation
v0.3.0
🚀 Key Updates
- Exception Handling Optimization
- Field Naming Standardization: Renamed description field to remark in exception classes for better industry
alignment- EZVIZBaseError.init(): description → remark
- EZVIZDeviceNotSupportedError.init(): description → remark
- Error Message Method Renaming: _get_error_description() → _get_error_remark() for naming consistency
- Type Safety Enhancement
- Region Type Strong Typing: Added explicit type annotation Region for region parameter in Client class
def init(self, app_key: str, app_secret: str, region: Region = "cn"): - Property Type Optimization:
- Client.area_domain return type changed from str to Optional[str] for more accurate representation of regional
API differences - Client.code return type changed from int to str to match the actual string type returned by the API
- Client.area_domain return type changed from str to Optional[str] for more accurate representation of regional
- OAuth Module Refactoring
- Error Code Constant Renaming: _ERROR_CODE_DESCRIPTIONS → ERROR_CODE_REMARKS for consistency with exception
handling naming - Type Definition Improvement: Defined separate types ErrorResponseCN and ErrorResponseEN for domestic and
international error responses, enhancing type safety - Data Encapsulation Optimization: Added region-specific type casting in AccessToken.init() to ensure data
type accuracy
💡 Upgrade Recommendations
- Code Compatibility: If you previously used the description field, please update to remark
- Type Checking: Enable type checking tools (such as mypy) to fully leverage the new type annotations
- Region Configuration: You can now configure different regions more safely, with the type system helping to
catch configuration errors
📌 Version Information
- Current Version: v0.3.0
- Previous Version: v0.2.0
- Compatibility: Backward compatible, no breaking changes