gluap / pyduofern

GNU General Public License v2.0
40 stars 11 forks source link

Add Home Assistant custom component to HACS #28

Open DomiStyle opened 4 years ago

DomiStyle commented 4 years ago

It would be nice to have the custom component available in HACS so updating is easier.

The requirements are listed here: https://hacs.xyz/docs/publish/start

While it's possible to get a sub directory added as repository it probably would make more sense to copy the current HA component to a new repository?

gluap commented 4 years ago

This sounds like a good idea. Also at first glance the requirements seem achievable with reasonable effort. I'll try to look into this over the weekend. Do you already have experience with providing components via HACS?

DomiStyle commented 4 years ago

@gluap I don't but I would be willing to help if there's a repository to work with.

gluap commented 4 years ago

@DomiStyle status update: I started working on it in a separate repository (I agree this makes more sense) and think the best will be to move the custom component there completely once it works (while leaving a readme in this repo for people to find that installed the old way and maybe another readme in the new repo for those who don't want to switch to hacs).

Currently it's just a stub but you can find it here https://github.com/gluap/pyduofern-hacs .

So far I only did the first few steps in the tutorial and haven't really set up anything yet so I wouldn't expect it to work. But after promising to work on it over the weekend I thought I should post an update.

DomiStyle commented 4 years ago

I added the repository to my Home Assistant instance and it looks like this in HACS:

hacs_ui hacs_ui2

I didn't try to install it yet since i need to disable the original custom component first but looks good so far.

This is the repository for HACS itself so it can probably be used as reference for the readme and info file: https://github.com/hacs/integration

gluap commented 4 years ago

I ran a first test using it as a custom component and it works (installs latest version of pyduofern and the module "just works" with the existing config). I'll implement some more suggestions from their readme and at some point send a pull request to add it to hacs.

DomiStyle commented 3 years ago

Took me quite some time but with the release of Home Assistant 2020.12 I finally found some time to switch over to the HACS version.

So far no issues, everything works perfectly and should be a lot easier to maintain.

rakaandro commented 3 years ago

Hello, thanks for your work!

I wanted to test it too:

RaKa

gluap commented 3 years ago

hi @rakaandro, it's not yet at the stage where it's available from hassHACS from the default repos, to install it via HACS you need to add the hacs repo https://github.com/gluap/pyduofern-hacs as a source for integrations. You can add custom repositories by clicking three menu dots on the top right in HACS and selecting "Custom Repositories" image

bcutter commented 3 years ago

What´s the current status on this?

Sounds like the easiest way to use your great work in Home Assistant especially when using HASS OS.

DomiStyle commented 3 years ago

@bcutter Works perfectly from HACS, just follow the steps a post above and it will be installed automatically.

bcutter commented 3 years ago

Alright, installation done. But the pairing process for new devices is somehow intransparent. I

BUT: what is the expected outcome in Home Assistant? Integration still shows: grafik

grafik

Shouldn´t there be a new device and an entity? Please assist. Adding the integration by the way worked smoothly.

Update: found the entity named with the paired device' ID.

Would be good to have them shown on the integration page, mockup see: grafik

gluap commented 3 years ago

Hi @bcutter, what kind of device are you trying to pair?

When going through your entities, does searching for "duofern" list the entity you paired?

I see that other integrations do somehow manage to show their integrated devices and entities on that pane. My guess is that the whole pairing mechanism used by the duofern integration somehow works around what was meant for pairing from the homeassistant side. Back when I wrote it there just was no framework available for pairing-like actions (or maybe it was too hard to find). This is also why pyduofern is using the "call a service" as a workaround to trigger pairing.

I'll file this as a new bug, but as it is hacs-only It'll be in the issue tracker of pyduofern-hacs

bcutter commented 3 years ago

Everything is working meanwhile in terms of pairing. Besides very few situations where commands have not been executed by the RolloTron device and few log warnings and fewer errors everything is fine.

Thanks for filing the idea as separate issue.