Skip to content

Code clean up, warnings fix#40

Open
gadulowaty wants to merge 61 commits into
dgtal1:devfrom
gadulowaty:dev
Open

Code clean up, warnings fix#40
gadulowaty wants to merge 61 commits into
dgtal1:devfrom
gadulowaty:dev

Conversation

@gadulowaty
Copy link
Copy Markdown
Contributor

No description provided.

gadulowaty and others added 30 commits October 9, 2022 18:18
Made changes to fix warning from HA core log file:
"HomeAssistantType was used from extalife, this is a deprecated alias
which will be removed in HA Core 2025.5. Use homeassistant.core.HomeAssistant
instead, please report it to the author of the 'extalife' custom integration"
Some constants for unit of measurements has been marked as deprecated.
This should happen in 2025.1 version.
Fix type declaration for supported features from int to LightEntityFeature
This fix is addressed to resolve issue of warning in Home Assistant
log "Detected blocking call to import_module inside the event loop by
custom integration 'extalife' at ..."
Added github address of extalife integration to report issues
This commit includes many changes:
* removing of unused imports
* grammar correction in comments
* source files reformating (wrapping code to 120 chars, spaces, new lines etc.)
* removing of duplicate const values
* marking unused callback params for valid code analysis
* correction of some imports to match changes in HA core

pyextalife.py:
* added parameter timeout for async_connect for changing default timeout to 10 sec while reconnecting controller
* better handling of raised exception when data sync with Ha occure while in disconnected state and reconnecting
* added identificatiors for some new devices (SLN-2?, RCW-21)
* replaced int values in DEVICE_ARR_*** with idents (in near feature will move to IntEnum type)
This commit includes many changes:
* removing of unused imports
* grammar correction in comments
* source files reformating (wrapping code to 120 chars, spaces, new lines etc.)
* removing of duplicate const values
* marking unused callback params for valid code analysis
* correction of some imports to match changes in HA core

pyextalife.py:
* added parameter timeout for async_connect for changing default timeout to 10 sec while reconnecting controller
* better handling of raised exception when data sync with Ha occure while in disconnected state and reconnecting
* added identificatiors for some new devices (SLN-2?, RCW-21)
* replaced int values in DEVICE_ARR_*** with idents (in near feature will move to IntEnum type)
This commit includes:
* device.py: DeviceFactory variable name error during check for transmiter (was "type" should be "device_type")
* added debugger detection in ExtalifeAPI, required to obfuscate passwords written to log files, when no debbuger is connected
* fix CoreType import in device.py
* fix grammar in pl.json
Changed to use HA async_add_import_executor_job
This fixes warning about async_add_job calls that will be deprecated in version 2025.4 of HomeAssistant.
Also small fix small typos.
Added missing typings in pyextalife.py
Changed Exta Life commands type to ExtaLifeCmd(IntEnum)
Changed response status to APIStatus(StrEnum) - type name will be probably changed in the near feature
… using defined factor for sensor (with type conversion)

* Added type hinting for HomeAssistant Entities
* Added more restrictive constraint for native_value recomputing when using defined factor for sensor (with type conversion)
* Added type hinting for HomeAssistant Entities
Added missing ExtaLifeController entity remove from HA entity registry for extalife platform during unloading integration
This sensor measure wind speed and illuminance.
In initial stage this sensor was km per hour, now it is meter per second.
…single command GET_EFC_CONFIG_DETAILS

This is change, requires EFC firmware version 1.6.0-release. Due to this change python module getmac is no more required, besides in old version there was problem with this method. When HA was in other network segment module getmac reported wrong mac of EFC controller.
Added translation for extra state attributes - still more to be done.
…many more...

Major fixes:
* config_flow for options during first step did not load stored values - always used defaults
* fixed integration reloading from GUI (not all entites were deleted)

Minor fixes:
* more type hints added
* added missing elements in manifest.json (integration_type, iot_class)

Major improvements:
* changed initialization logic of integration, now it is possible to correct invalid credentials during loading
* if EFC-01 is not available during initialization of integration HA will repeat loading later
* added possibility to reconfigure defined controller settings from GUI (no more editing internal HA files)
* added possibility to download and review integration diagnostic data
* removed dependency on external package getmac, now EFC controller MAC is fetched directly from controller during integration initialization
* added new service config_backup, now it is possible to download complete configuration from controller
* added classes for representing ExtaFile communication entities (ExtaLifeRequest, ExtaLifeResponse)
* reworked exception handling in ExtaLifeAPI
* added handling of error codes while communicating with EFC-01
* moved connection watchdog form integration core directly to ExtaLife API
* added new params for events coming from ExtaLifeConn (previously known as TCPAdapter)
* EFC-01 entity now show different states (connected, disconnected)
* added more extra_state_attributes to controller entity in HA

Minor improvements:
* added missing and corrected existing translations in json files
* added icons for services
…ill stop working

* moved import_executor_callback method into core class - no need to expose to outside world
…ill stop working 2025.6

* moved import_executor_callback method into core class - no need to expose to outside world
* added possibility to add new entities after initial discovery is done
* changing string formating to f-string form (recommended by HA project directives), more to be done
* removed no more used functions async_setup_platform, only async_setup_entry
* renamed property of Core data_manager to channel_manage, due to inaccurate naming
* removed unused private fields
* channel_id creation moved to ExtalifeAPI
* replaced public properties with private fields as those properties were used internally
* corrected comments - replaced Data Manager with Channel Data Manager
* device_info is now provided from base ExtaLifeEntity class
* Fixed missing channel field in response messages from EFC for Exta Free devices (occurring from firmware version 1.6.29-release)
* Fixed Exta Free device controlling (SRP-02)
Since now, versions marked with odd beta numbers will be released by Gadulowaty. Versions marked with even beta numbers will be released by dgtal1.
Moved HA entites to separate files entites.py
…activePower.VOLT_AMPERE_REACTIVE (will be removed in HA Core 2025.9)
…_status to battery and power factor from 100 to 1
…om unix timestamp to datetime.

Small improvements in cover (gate) sensors.
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.

2 participants