Skip to content

Commit

Permalink
Auto-detect sensors and strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ankohanse committed Jan 19, 2024
1 parent 9a5fd8a commit 351a79f
Show file tree
Hide file tree
Showing 11 changed files with 842 additions and 676 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ Copying all files in `/custom_components/dabpumps/` folder from this repo into t
│ ├── translations
│ │ └── en.json
│ ├── __init__.py
│ ├── api.py
│ ├── binary_sensor.py
│ ├── config_flow.py
│ ├── const.py
│ ├── coordinator.py
│ ├── dabpumpsapi.py
│ ├── diagnostics.py
│ ├── helper.py
│ ├── manifest.json
│ ├── sensor.py
│ └── strings.json
Expand All @@ -72,8 +74,8 @@ Copying all files in `/custom_components/dabpumps/` folder from this repo into t

## Configuration

The custom component was tested with a ESybox 1.5kw with firmware v5.29.0 combines with a DConnect Box 2 with firmware 7.03.
I expect it should also work for an ESybox Mini and probably also for other devices.
The custom component was tested with a ESybox 1.5kw combined with a DConnect Box 2.
It has also been reported to function correctly for ESybox Mini and ESybox Diver.

To start the setup of this custom integration:
- go to Home Assistant's Integration Dashboard
Expand Down Expand Up @@ -119,5 +121,10 @@ logger:
## Credits
Thank you for giving a great example of how to create a custom controller: [MindrustUK](https://github.com/MindrustUK)
Special thanks to the following people for their testing and feedback on the first versions of this custom integration:
- [Djavdeteg](https://github.com/Djavdeteg) on ESybox Mini 3
- [Coldness00](https://github.com/Coldness00) on ESybox Mini 3
- [benjaminmurray](https://github.com/benjaminmurray) on ESybox Mini 3
- [Bascht74](https://github.com/Bascht74) on ESybox Diver (with fluid add-on)
19 changes: 11 additions & 8 deletions custom_components/dabpumps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
)

from .coordinator import (
get_dabpumpscoordinator,
DabPumpsCoordinatorFactory,
DabPumpsCoordinator
)

Expand All @@ -28,6 +28,7 @@
DOMAIN,
API,
COORDINATOR,
HELPER,
CONF_INSTALL_ID,
CONF_INSTALL_NAME,
)
Expand All @@ -38,7 +39,8 @@


PLATFORMS: list[Platform] = [
Platform.SENSOR
Platform.SENSOR,
Platform.BINARY_SENSOR
]


Expand All @@ -48,8 +50,9 @@
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the component."""
hass.data[DOMAIN] = {
API: {}, # key is username+hash(password)
COORDINATOR: {} # key is install_id
API: {}, # key is username+hash(password)
COORDINATOR: {}, # key is install_id
HELPER: {} # key is install_id
}

for entry in hass.config_entries.async_entries(DOMAIN):
Expand All @@ -69,11 +72,11 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
install_id = config_entry.data[CONF_INSTALL_ID]
install_name = config_entry.data[CONF_INSTALL_NAME]
options = config_entry.options

_LOGGER.debug(f"Setup config entry for installation '{install_name}' ({install_id})")

_LOGGER.info(f"Setup config entry for installation '{install_name}' ({install_id})")
# Get an instance of the DabPumpsCoordinator for this install_id
coordinator = get_dabpumpscoordinator(hass, config_entry)
coordinator = DabPumpsCoordinatorFactory.create(hass, config_entry)

# Fetch initial data so we have data when entities subscribe
#
Expand Down
Loading

0 comments on commit 351a79f

Please sign in to comment.