You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

2h 0m 53s logged

Started taking the integration blueprint and did, something with it.

The MediaWiki API can take requests, which may be easier to code, but then the results have to be parsed. So I’ve decided to use the pywikibot library results, which sends things in a nicer way.

However, Home Assistant expects integrations to not make blocking calls.. and I think that actual network requests are made when you call for the operation. So if you make a page object, I don’t think it actually gets anything until you call page.extracts(). So the entity can’t call that, otherwise you get a blocking call. The coordinator needs to manage things specifically.

So this will eventually tie into making appropriate entities and representations of data - which, may be difficult, because HA does not expect entities to store the entire text of a Wikipedia article. But things like feeds are in RSS, so they may need separate handling - so basically, a bit of work to do of how this can be put into practice. I imagine a “Today’s featured article” kind of thing, but maybe that can be done simply with RSS feeds.. but I don’t think pywikibot handles that (it expects JSON responses). So, much more to dive into!

0
2

Comments 0

No comments yet. Be the first!