Include libraries and update native projects on plugin install

We are using the cordova-crashlytics-plugin and are looking to upgrade to a newer plugin that uses the updated Fabric SDK.
There are two things this old plugin does that makes it really convenient to use.

It includes the Fabric SDK libraries with the plugin.
Uses an after_plugin_install build hook to modify the iOS and Android projects.

This makes it possible to use the plugin without checking in the platforms directory or doing any manual configuration steps. I would assume this would also take care of #2 as well.

I've started working on this for my own project. Before I get too far, I'm just curious if you'd accept this as a pull request to your project, instead of me creating yet another plugin on npm.
My changes will be:

Add Framework for iOS
lib/ios/Crashlytics.framework
lib/ios/Fabric.framework
Add Framework for Android
lib/android/crashlytics.jar
lib/android/crashlytics-devtools.jar
lib/android/crashlytics_build.xml
lib/android/crashlytics_build_base.xml
Add build hooks to modify platform projects on plugin add
Add build hooks to remove platform project modifications on plugin remove

Please feel free to send me your PR and please add yourself and contributor.

I'm getting to close being done; I've got the automatic setup of the Fabric libraries for both iOS and Android:
https://github.com/Justin-Credible/FabricPlugin/commits/feature/auto-configure-fabric
For my own project, I ended up needing some extra logging events for Answers that did not exist yet, so I started adding them. This lead me to the .es6 files. Would you mind if I removed these and just use a plain JavaScript interface instead? While I am a fan of ES6, TypeScript, etc, it seems overkill in this case since the JavaScript methods simply delegate to cordova.exec(...). Otherwise contributors will need to setup babel to make changes to the JavaScript files.

I was checking your repository, awesome job. Please create the Pull Request when you feel that the code is ready and add yourself as contributor!

I ended up going forward and implementing all of the APIs for Answers, as well as added run-time tests and TypeScript definitions.
This turned out to be a rather large refactor touching all files.
I also bumped the version to 1.0.0 since all of the Crashlytics and Answers APIs are now present.
Let me know what you think.

@Justin-Credible @sarriaroman curious; under which license is lib/ios/* distributed and from which url at fabric's servers do they originate?

These iOS framework bundles were obtained from Cocoapods:
https://cocoapods.org/pods/Fabric
https://cocoapods.org/pods/Crashlytics
Podspec references:
https://github.com/CocoaPods/Specs/blob/master/Specs/Fabric/1.6.5/Fabric.podspec.json
https://github.com/CocoaPods/Specs/blob/master/Specs/Crashlytics/3.7.0/Crashlytics.podspec.json
Framework package ZIPs:
https://kit-downloads.fabric.io/cocoapods/fabric/1.6.5/fabric.zip
https://kit-downloads.fabric.io/cocoapods/crashlytics/3.7.0/crashlytics.zip
I've put in a pull request to put the above information into a readme file in the lib/ios directory.

@Justin-Credible thanks!

@Justin-Credible You linked to crashlytics 3.7.0, while f8ba9cf3c31b827e85d1f3dcb22f054679cddf94 (which seems to be the latest update to lib/ios in master at the time of writing) refers to crashlytics 3.6.0.
Seems accurate otherwise: For peace of mind I verified with diff -r that the contents of lib/ios indeed matches what the following urls deliver to me ATM (unzipped) :+1:
https://kit-downloads.fabric.io/cocoapods/fabric/1.6.5/fabric.zip
https://kit-downloads.fabric.io/cocoapods/crashlytics/3.6.0/crashlytics.zip
(Maybe it would be possible to get the files on demand from Fabric's servers using some Cordova hook, more along the lines of the Cocoapods workflow and the Maven workflow for the Android conterparts? https://github.com/sarriaroman/FabricPlugin/blob/master/hooks/lib/android-helper.js#L16 - That would eliminate the question whether or not the Fabric team is OK with redistribution or not and would keep this repo smaller (except one version is already in the Git history). Not sure exactly how to do it though...)

@tomsun Ah! Thanks for catching that. I must have copy/pasted the wrong URL. I'll update my pull request.


0.30.1 released with dill import but without dill in requirements

There's something wrong with the 0.30.1 release. The package you released does not correspond to the source code of the 0.30.1 tag.
For example, 6d6fcd1fb01c9254e266c93ff25fa8310e45b614 is missing, so the released package still has the dill import.
dill is not in the requirements, so projects using shap will have to manually install it.
Could you rectify the situation by making a new release?

I have the same issue:
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-16-d3f52b740e76> in <module>
      7 import sys
      8 import warnings
----> 9 import shap
     10
     11 # to import this mltb bist be installed from source - see first cell above

~/miniconda3/envs/tf2-2/lib/python3.6/site-packages/shap/__init__.py in <module>
     18 from .plots.embedding import embedding_plot
     19 from . import datasets
---> 20 from . import benchmark
     21 from .explainers import other
     22 from .common import approximate_interactions, hclust_ordering

~/miniconda3/envs/tf2-2/lib/python3.6/site-packages/shap/benchmark/__init__.py in <module>
      1 from . import measures
----> 2 from . import metrics
      3 from . import methods
      4 from . import models
      5 from .. import datasets

~/miniconda3/envs/tf2-2/lib/python3.6/site-packages/shap/benchmark/metrics.py in <module>
     13 import hashlib
     14 import os
---> 15 import dill as pickle
     16
     17 try:

ModuleNotFoundError: No module named 'dill'

That's what I get for bumping a version and then traveling for a week. Sorry about that. It should only effect the source code package on pip (which is obviously an important version). I am pushing a 0.30.2 that makes the dill dependency optional (since it is only used for benchmark tests).

@slundberg ping about 0.30.2 :)

Thanks!


Clean up the docs directory

Now that we've started to consolidate our outward facing documentation in the online tutorial and reference guide, it seems useful to clean up some of the extraneous files in the verus/source/docs directory, so that users don't stumble on outdated/internal notes.
Thus far, I have removed documents that appear to be outdated, and I moved talk/poster information into the verus-papers repo.   Apologies in advance if I accidentally deleted a file or files that are still useful/relevant (e.g., @chanheec I deleted files related to bit vectors and non-linear arith on the theory that I believe they're all subsumed by your documentation PR #597).  Please feel free to point out things that should be saved!
After the purge above, there are three remaining doc files to deal with.
@tjhance Do we still need trait-notes.md?  If so, perhaps we can create a new internal directory and put it there to communicate that we don't expect Verus users to read such docs.
@Chris-Hawblitzel Has modes.md been subsumed by the official tutorial and/or the upcoming OOPSLA paper?
@utaal Could syntax.md possibly be incorporated into your attribute documentation on #638 ?

@tjhance Do we still need trait-notes.md? If so, perhaps we can create a new internal directory and put it there to communicate that we don't expect Verus users to read such docs.

I've been meaning to return to that file and do a more thorough write-up. Can you make an internal directory like you suggested?

@utaal Could syntax.md possibly be incorporated into your attribute documentation on https://github.com/verus-lang/verus/pull/638 ?

Yes! I'll work on that.

I've been meaning to return to that file and do a more thorough write-up.

Done!

Yes! I'll work on that.

Great, thanks!

I think modes.md has some value but would be better in the internal directory.

Thanks all!  I implemented the actions discussed above and in the Verus meeting, so I'm going to merge this in.


Incompatability With The Latest GTCE Builds

Recently, the e-net system in GTCE was changed and so now the Fission Reactor has broken TOP tooltips

And the following crash occurs when a cable is connected to it.
https://pastebin.com/N8pqRv1z

Oh dear... well, I'll get that updated I guess!

Fixed!


Unable to use vector assets feature of xcode 6

Xcode 6 introduced the vector assets feature detailed here http://martiancraft.com/blog/2014/09/vector-images-xcode6/
I'm unable to require(image!myVectorImage) in react-native 0.6. It raises the following error,
 message: Requiring unknown module "image!myVectorImage". If you are sure the module is there, try restarting the packager."

Normal PNG images work just fine.

That's because packager doesn't know about it. Try adding your file extension to this list https://github.com/facebook/react-native/blob/master/packager/packager.js#L218

Why was this closed? Did adding the extension (presumably pdf) work? I've been trying to add density independent vector drawables the same way for Android, under react 0.14 and they also don't work (even if I add xml to ln 60 in packager/react-packager/src/Server/index.js).
On the other hand, if I remove 'png' from that same list, pngs are now unsupported, so it seems that array is where the difference lays, but maybe I'm wrong about that?


Error when  setting "metrics_enabled = true" to terraform code

When I attempt to enable metrics for my nginx ingress controller via terraform, Terraform errors out with the following:
Error: unable to recognize "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
Has anyone else faced this issue?

Hello, it works only if you have prometheus-operator


nix uses deprecated ghc-pkg package databases

GHC HEAD has removed the ghc-pkg single file configuration databases in favor of the folder databases  initialized via 'ghc-pkg init $dbDir'. This means that nix can't install any packages with GHC HEAD, and it will break when GHC 7.10.1 comes out and we inevitably update. The new folder-style database was added in GHC 6.12, so it shouldn't break anything old to update. I'm writing a solution now..

This has been fixed in the haskell-ng package set.


Generate starter files

See:

https://github.com/alphagov/govuk-prototype-kit/issues/1530
https://github.com/alphagov/govuk-prototype-kit/issues/1521

This PR makes the kit a package only and all unit, integration and acceptence tests have been changed or removed to suit.
Please note that the templates in the cypress tests will be cut down in a future ticket to only contain the content and structure being tested.

This PR breaks our ability to deploy review apps automatically, is that an issue we want to fix, or shall we just turn off review apps for this repo?

In commit 02973418d0dbc40ca3d90f28ff7953d0d0f9372e (Cypress tests) we move the files from docs/views/templates to the Cypress fixtures folder, is this correct? Do we not want to include these templates with the prototype starter?

I think it might be helpful to have a changelog entry detailing all the user facing changes this PR makes, including things like assets no longer being copied to the public folder and which kit code is no longer in the userspace.

In commit https://github.com/alphagov/govuk-prototype-kit/commit/21aefc0f629817fc9144d5362dc71175ffe9aea7 (Generate starter files) we don't move the files from docs/views/templates to the prototype-starter folder, is this correct? Do we not want to include these templates with the prototype starter?

Yes, that's correct. I believe these should be in documentation rather than in the kit itself, after v13 we should expect not to make any changes in user space so any templates we provide in the starter kit will fall out of sync and get out of date.
I don't know if documentation is the right place for them but I know that providing them in the starter kit will lead us into problems that I'd rather avoid if we can.

The changes to the project structure breaks our ability to deploy review apps automatically, is that an issue we want to fix, or shall we just turn off review apps for this repo?

If the review apps are useful to us it would be good to fix them but I think this can happen later.


OpsGenie2 service-tests API error

POST /kapacitor/v1/service-tests/opsgenie2
{
    "teams": null,
    "recipients": null,
    "message-type": "OK",
    "message": "test opsgenie message",
    "entity-id": "testEntityID"
 }

Runtime error: index out of range - kapacitor/services/opsgenie2/service.go:191

details.series[0] is out of range. details is a models.Result.   I don't know if it is valid to have no series and if this needs to write range more safely or if having series present is a pre-condition, though.

Hey guys! is there any workaround for using OpsGenie API v2 with Kapacitor v1.4.1 before v1.5 will be released? Thnx!


FFLogs Effect event encountered with no packet ID, did not match to over time status effect (DoT/HoT)

I've met the above error when analysing my own fflogs about the unfinished Titan(Unreal) Trial and clicked one of the characters. After some time passed, I met this error and I don't know the reason.
Web browser: Microsoft Edge with Chromium 92.0.902.67
fflogs: https://cn.fflogs.com/reports/WVzb2nJhwGc9KdfY/#fight=8

Apologies for the delay, this error message happens when the log is missing a sequence ID, which we use to link actions to their effects, and has no status ID. Damage/Heal over Time events don't have the sequence ID, but the error means that the event doesn't match any known statuses to tell us what it is. Usually this happens when the log has bad data, which can happen with a network fault, memory misread, or in fflogs' parsing of it.


Remove banner from source files, use grunt-banner instead

https://github.com/mattstyles/grunt-banner

Can I just confirm, is the aim:

To have a task which ensures that all source TypeScript files have the correct banner?
Or to remove the banner from all source TypeScript files and put it at the top of the generated JavaScript files instead?

I am assuming the latter but none of the generated JavaScript files currently have any comments in, in which case these banners would be the exception.


Accessibility

Plan for beta
Output of consultation
Design choices
Why DataHub isn't suitable
Iterations to design
Evidence of testing with people with accessibility needs (15%)

The service assessment desk can used as a basis for this: https://docs.google.com/presentation/d/1gceWOAYirgbLcaw3zKRbg1r98BLuIZW-xgFbxZdslmA/edit#slide=id.g2b75f47d2f8_0_0


problem with Biomass in the IAM variables mapping

changed 'exists in database ' to True

just a workaround at this stage


Use different configuration for other targets

Hi!
Can I use different build configurations for other targets?
For example,
I have two targets:

app-stage
app-appstore

and I want to use Debug only for app-stage and Release only for app-appstore, how I can do this?

@rock88 Xcake should do this out of the box without the need for multiple targets. If you specify the build configurations for a target then xcake will generate a scheme for you.
However if  you still want to do it this way, specifying your own build configurations for the project will stop xcake generating the defaults (just provide a name for it as a parameter).
I'm not sure if the Xcode project allows you to do this though.

@rock88 Xcode defines build configurations per project, so all targets share the same set of configurations. That means for every target you'll be able to set the same build settings for all configurations, or different settings per each configuration. Xcake also will generate Schemes for each target and configuration. For example, if you have targets "t1" and "t2" and configurations "Debug", "Stage" and "AppStore", then you'll have 2*3 = 6 Schemes: "t1-Debug", "t1-Stage", "t1-AppStore", "t2-Debug", "t2-Stage", "t2-AppStore".
As a best practice, what you are trying to achieve (based on the names of targets you provided) is usually done by having different build configurations (as in my example above) for a single target. That's true if these versions of the app have the same source files included and the only difference between debug/stage and AppStore version of the app are build settings (note, that you can include any custom/user-defined build settings - for things like API server address, etc. - and have references to them from your Info file to access them in run time), as well as you can have different dependencies (for example, via Cocoapods) for different build configurations of the same target.
But even if you still need several targets - Xcake will generate all schemes for all targets, but it's up to you which ones to use for one target, and which ones to use for another target - I mean you can just ignore (or even hide) some schemes for some targets if you do not need them).
I hope that helps.

@jcampbell05 @maximkhatskevich  I think you are right, and few schemes for one target it's not problem.
Thanks you!


Small environments  missmatch

The information in this page doesn't match with other parts of the documentation when looking for information on smaller environments. for example:
https://github.com/Azure/Enterprise-Scale/
https://github.com/Azure/Enterprise-Scale/blob/main/docs/reference/treyresearch/README.md
on these pages the platform subscriptions are merged into one.

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 54688c3b-0c16-6490-97c6-d92446d2553c
Version Independent ID: 54688c3b-0c16-6490-97c6-d92446d2553c
Content: Subscription considerations and recommendations - Cloud Adoption Framework
Content Source: docs/ready/landing-zone/design-area/resource-org-subscriptions.md
Service: cloud-adoption-framework
Sub-service: ready
GitHub Login: @martinekuan
Microsoft Alias: martinek

@jtracey93 - anything to add to this page about the pros/cons of highly compressed platform implementations?  I assume we wouldn't ever recommend it which is why it's not listed here.  But would like to get your take on @Vrolir's observation.
@Vrolir, do you have any more clarity on the type of guidance you're looking for?  Knowing there is a perceived mismatch is fine, but what information would you be looking for to help you make a decision?

100% correct @ckittel, we really dont advise single platform subscriptions as migrating out of them later is difficult. For example you cannot migrate an ExpressRoute circuit to another subscription, you must re-provision a new ExpressRoute entirely; hence splitting out from the start is the best approach, and it doesnt cost anything extra.
We explain this in our principles under Subscription Democratization
Also recommend a watch of the YouTube Video on this topic here: https://youtu.be/R-5oeguxFpo?si=Ptq4dDUrwFqzd0sI

Thank you, Jack.
@Vrolir I'm going to mark this question resolved. If you'd like to see some more warnings on the Trey research implemention, feel free to open up an issue on that repo.
#please-close


Remove the cluster ID before creation of disk image.

We need different cluster ID for different clusters so we need to remove it.
$ oc patch clusterversion version -p '{"spec":{"clusterID":""}}' --type merge

fixed by #63


Build failure: Certificate expired openssl 1.1.1l

Build error - certificate expired
MacOS Ventura 13.2.1 Macbook Air M2 2022
% uname -v -m
Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:43 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8112 arm64
% make test TESTS=80 V=1

see attached file for make config and full output of this command Test Summary Report
../test/recipes/80-test_ssl_new.t     (Wstat: 256 Tests: 29 Failed: 1)
  Failed test:  12
  Non-zero exit status: 1
Files=19, Tests=90, 11 wallclock secs ( 0.14 usr  0.05 sys +  5.79 cusr  1.81 csys =  7.79 CPU)
Result: FAIL
make[1]: *** [_tests] Error 1
make: *** [tests] Error 2

testdata.zip

cloning the repo and switching to the stable branch for 1.1.1 it compiles and tests fine. This was the download of 1.1.1l that failed.


Add 'null' client patch.

This is useful when trying to debug the patched client crashes ( patched client has many named functions exported, so stack traces in debuggers that can use them, are much more readable )

The I0 null stuff builds fine here, but I've no way to test the MSVC build. Appveyor passes for this however. Regarding the tint changes to MapViewer, no functionality has changed -- it's merely cosmetic to make it easier to read the parameters. Given the aforementioned information and considering there are no merge conflicts or build errors, this can be merged.


Add platform-agnostic storage support code

Note: the SQLite files just came with the sqlite-net package. Apparently that's how it works.

I feel like the Game should provide its own game name, rather than it being passed to the host directly. Drawables already have a Name attribute, so you could potentially just use that. Host could access this by this.Children.First().Name.

This name has to be valid for directory names, which is why I caution from making it come from a less isolated place.

How about doing the directory safety in a property in BasicGameHost?
SafeGameName => GeneralHelper.GetSafeFilename(Children.First().Name)

Could do that, but assuming we want i.e. ~/.local/share/osu instead of ~/.local/share/Osu! the use of a common string could be confusing.

Hmm, I'd say that the Name property should be the internal name (osu in this case) and we'd override ToString or use a new string ReadableName property at Game for the titlebar/user-facing name.

Sounds like a plan. I'll make that change in the morning.

👍
everything looks fine otherwise.


Add support for JSON keyfile.

+1. Have been wanting this for seconds.

Fixed in v1.1.0 :cherries:


TypeError: assign is not a function

Bug or support request summary
npm run storybook fails on CRNA project because assign is not a function.
I tried to compile with node 6.0.0 or 8.3.0. Is there something I need to install to fix this issue as a global polyfill? Is it possible to use Storybook 3.0 and maybe not an alpha version?
TypeError: assign is not a function
    at Object.<anonymous> (....node_modules/@storybook/core/server.js:7:18)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (...node_modules/@storybook/react-native/dist/server/config/webpack.config.js:35:15)
    at Module._compile (module.js:541:32)

Please specify which version of Storybook and optionally any affected addons that you're running

@storybook/react-native 4.0.0-alpha.10x.x.x
@storybook/addons 4.0.0-alpha.10x.x.x

Do you have a babel-runtime installed?

Thanks for your help @igor-dv but I did not. Apparently, this package is not automatically installed after create-react-native-app. That being said, after running npm install babel-runtime followed by npm run storybook,  I end up with the following different error:
sh: storybook: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR<EMAIL_ADDRESS>storybook: `storybook start -p 7007`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>storybook script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!    .../.npm/_logs/2018-06-27T22_34_52_493Z-debug.log

In package.json, I have the following under scripts:
"scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "jest",
    "storybook": "storybook start -p 7007"
},

What's surprising for me is I'm able to do npm run start without any issue.

same issue

npm: v6.1.0
webpack: 4.12.2
node: v8.11.2

@GozuPro , looks like the storybook package script is wrong for you. There was a similar issue here #1726, please take a look.
Regarding the assign problem, storybook has a peer deps on babel-core and babel-runtime. please check that you have these deps installed.

@igor-dv, looks like the README.md is incomplete or the 4.0.0-alpha version isn't ready.
I started from scratch with the following:
npm i -g create-react-native-app
create-react-native-app my-project
cd my-project
npm start
npm i -g @storybook/cli
getstorybook
npm run storybook

As described, I updated App.js to contain the following: export default from './storybook';
From there, I even tried the following without success:
npm install babel-runtime
npm install babel-preset-es2015
npm install babel-preset-stage-2
npm install babel-core

What should I do because I'm losing patience on your promising package. Is someone able to create a CRNA project with Storybook version 4.0 working?
Thanks

For the alpha version you should use an alpha version of the cli as well

I'm having the same issue, did anyone figure out a solution?

Same here, any progress?

I solved it by doing a manual installation of version 3.x following these
instrutions: https://storybook.js.org/basics/guide-react/
On Wed, Jul 25, 2018 at 11:00 AM Magnus Görlitz<EMAIL_ADDRESS>wrote:

Same here, any progress?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/storybooks/storybook/issues/3807#issuecomment-407684993,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAMBKVJYuRK32JpS4iEzLJiltkC_5oafks5uKDOlgaJpZM4U6YC0
.

be sure to install babel-runtime v6 (instead of v7)
which is storybook depends on


RainMachine via auto discovery fails to pair with HomeKit key

The problem

I am adding RainMachine Pro-8 to Home Assistant - using the auto discovery feature when I click on CONFIGURE, it asks for the Home Kit pairing number. I enter it in the format requested XXX-XX-XXX and it throws and error.
An unhandled error occured while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently.
Environment

Home Assistant release with the issue: 0.105.2
Last working Home Assistant release (if known): N/A
Operating environment (Hass.io/Docker/Windows/etc.): Hassio
Integration causing this issue: RainMachine
Link to integration documentation on our website: https://www.home-assistant.io/integrations/rainmachine/

Problem-relevant configuration.yaml

Traceback/Error logs

Pairing attempt failed with an unhandled exception

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.py", line 333, in async_step_pair
    start_pairing, self.hkid, self.hkid
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homekit/controller/controller.py", line 383, in start_pairing
    salt, pub_key = perform_pair_setup_part1(write_fun)
  File "/usr/local/lib/python3.7/site-packages/homekit/protocol/__init__.py", line 113, in perform_pair_setup_part1
    response_tlv = write_fun(request_tlv, step2_expectations)
  File "/usr/local/lib/python3.7/site-packages/homekit/protocol/__init__.py", line 64, in write_http
    connection.endheaders(request)
  File "/usr/local/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/site-packages/homekit/http_impl/http_client.py", line 44, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 938, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 728, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Additional information
I tried doing the manual way by adding the IP and password and that is working fine, I can see all the added entities. If I do it over the auto discovery, then it is showing this problem. I am not familiar with HomeKit and I don't use it for anything else, from searching online it looks like it should do the setup automatically, unless I missed something.
Thanks!

I'm not sure this is an issue with the rainmachine integration itself (since it can be configured outside of HomeKit). Going to tag this as homekit and see if a codeowner there can help.

I can across a new-ish section of the dev docs that gives me some ideas. Will experiment and report back.

I'm not able to even see my RainMachine over zeroconf (despite enabling it on the unit itself), so I'm not sure I can be much help here. Will keep open to see if anyone else has ideas.

Sorry didn't see this earlier, i'm only a code owner for homekit_controller (pretending to be an iPhone and pairing with accessories) not homekit (pairing with phones/ipads/etc and pretending to be a homekit hub).
@bachya There are some people who have RainMachine's and have posted here with the keys needed to what is suggested in the dev docs if thats any help.
@deemee As for the connection reset error, some devices are just more finicky than others. It's likely going to be really hard to sort out without getting hands on one myself. There is one change we could try (there are 2 pairing flows in the HK protocol, and we can enable the alternate one in the homekit_library with a single line code change). If you would like to help me out and try that let me know. That's a bit of a thorny issue for us so it would be great to gather some more data on it.
That said even if pairing works, homekit_controller might not recognise the characteristics your device exposes. Theres a list of supported types here. If we can get your device to pair it will produce a data file I can use to add support though, and a gain i'd be very interested in getting that file and adding support.
That said though it does looks like RainMachine has a local API (not a cloud based one). The main reasons to use homekit_controller are that its the only supported API (like koogeek lightstrips) or that the main official API is cloud based. Neither is the case here, so its probably better to have the RainMachine integration intercept the discovery as per the docs.
Even so, I would still like to try and fix the pairing issue if possible as it might help future (non rainmachine) users.

@Jc2k - sure, I can help as much as I can. I still have the device on my desk and it will be few more days before I start placing it on the wall.
You are correct this has the local API and it was one of the reason I bought it. I don't use HomeKit for anything else, I tried integrating this device using that as HA suggested it and I thought it will be a good approach.
When you are available, please provide a bit more info on the alternate pairing flow and I will help as I can. Even if I don't end up using it, the output might help for other users.

@deemee brilliant news!
OK so there are a bunch of pairing types we know about, but there are 2 that are almost identical from "our" side. We suspect the difference is whether or not your device has a Apple crypto chip in it. If you are able to get to the python interpreter where HA is installed you can do someting like this:
python -m homekit.discover

And after about 30 seconds you'll see something that looks like this:
Name: Philips hue - 123456._hap._tcp.local.
Url: http_impl://x.x.x.x:8080
Configuration number (c#): 16
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): FF:FF:FF:FF:FF:FF
Model Name (md): BSB002
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Bridge (Id: 2)

Most of the devices we have been able to pair seem to have an ff of 0 or 1. But newer devices (especially TV's) seem to have an ff of 8. We don't yet have a firm understanding of which devices need which pairing type so the first task is to collect discover output like ^ to try and prove our theories about ff values.
Then you need to find this file in your HA install:
lib/python3.7/site-packages/homekit/protocol/tlv.py

It's hard to give a more exact location - it depends on your install method and im not familiar with them all - for me thats a path within a virtualenv.
Near the top you'll find
    # Methods (see table 4-4 page 60)
    PairSetup = bytearray(b'\x01')

you need to change it to
    # Methods (see table 4-4 page 60)
    PairSetup = bytearray(b'\x00')

This will ask the device to pair without using a crypto chip.
If pairing succeeds you will see an integration in your UI with no entities (probably). Then you can go into the folder where your configuration.yaml is. I need the file .storage/homekit_controller-entity-map. That tells me what accessories it has found and what values i can read/write to. You should review it in case it contains anything sensitive. In particular you might want to search for 00000030-0000-1000-8000-0026BB765291 as it contains your devices serial number.

@Jc2k apologies for the late reply - life happened :)
Unfortunately I didn't have much luck with these steps. I am running HA on rpi4 (ex. hassio) and I installed the Terminal add-on. When I run the python command I get an error that the homekit module is not installed. I have the python3 install there.
I talked to somebody on discord and they suggested I add homekit: in my configuration.yaml, after doing that and restarting HASS I got the notification to bridge Homekit, so I opened my phone and did the integration.
This didn't trigger the auto discovery of the device. I tried to also reset the device and remove any pairing keys, but still it didn't trigger what I saw initially by HASS to ask about configuring the new device.
Please suggest what other steps I should try to trigger the pairing. I also checked in the services, but under Homekit it's only to remove an accessory.
Thanks!

@deemee no worries - i've been away a few days myself.
So the problem with HomeAssistant OS is that there are actually multiple linux installs at once. I suspect you ran the command in the host OS, but there is a container running inside docker and if you could get to that you would be ale to run the command.
I think the person on discord has sent you off on a tangent, unless we are talking at cross purposes too.:

homekit -> using your phone to control home assistant (by pretending to be a homekit bridge)
homekit_controller -> using home assistant to control accessories with a HomeKit logo on the box (by pretending to be an iOS device)

They are 2 seperate things, and homekit: turns on homekit not homekit_controller. I can only help you with homekit_controller, not homekit. And setting up one has absolutely no effect on the other.
I'll try to do some more research into HA OS and how to get a command line interface to the "right" file system, but in the mean time do you have another linux computer on the same network? The commands i need you to run don't need home assistant and it might be easier if it wasnt in the way.

@Jc2k - yup I felt that way too, but I am new to homekit and I thought I am missing something. On the bright side, I am using homekit on my phone now haha :D
Yes - my initial issue was raised for the homekit_controller as that is the one that auto pop in HASS once the device came available on the network for auto configure/discovery. That is what I am trying to help you debug further now, not the bridge portion, which seems to work fine on the iPhone.
Regarding the command line interface, I do have several Linux machines on my home network, they don't have HA but as per your comment that should be fine. Do you have some steps or guidelines of commands I should run? Will the ones above work? I assume I need to install homekit module, but I will wait for your instructions if possible.
Thanks!

@Jc2k - I installed Raspian on a spare RPI4 and ran the commands, unfortunately it throws an error. I searched for the error and I found another thread (#25118) that you responded there but it just mentioned version 0.15 there, no solution that I could see.
The error is:
pi@raspberrypi:~ $ ./homekit_test/bin/python -m homekit.discover Traceback (most recent call last):   File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main     "__main__", mod_spec)   File "/usr/lib/python3.7/runpy.py", line 85, in _run_code     exec(code, run_globals)   File "/home/pi/homekit_test/lib/python3.7/site-packages/homekit/discover.py", line 51, in <module>     results = Controller.discover(args.timeout)   File "/home/pi/homekit_test/lib/python3.7/site-packages/homekit/controller/controller.py", line 90, in discover     return discover_homekit_devices(max_seconds)   File "/home/pi/homekit_test/lib/python3.7/site-packages/homekit/zeroconf_impl/__init__.py", line 102, in discover_homekit_devices     info.properties   File "/home/pi/homekit_test/lib/python3.7/site-packages/homekit/zeroconf_impl/__init__.py", line 180, in parse_discovery_properties     d['category'] = Categories[int(category)]   File "/home/pi/homekit_test/lib/python3.7/site-packages/homekit/model/categories.py", line 94, in __getitem__     raise KeyError('Item {item} not found'.format(item=item)) KeyError: 'Item 28 not found'
I tried running as root as well, and when doing this I am setting the device in pairing mode, it displays the QR code plus the 8-9 digits for pairing.

Thanks for doing this @deemee. This is a relatively new category for the HomeKit protocol, so homekit_python doesn't know what it is. The very latest version from git does, though. But the next home-assistant release will switch to aiohomekit instead of homekit so that we can have state change notifications and not exclusively rely on polling. So what about trying:
python3 -m venv homekit_test
./homekit_test/bin/pip install aiohomekit[IP]
./homekit_test/bin/python -m aiohomekit discover_ip

The latest release should already ignore categories it doesn't recognise.

Thanks @Jc2k - now the discover returned some results. I ran the command and placed the device in pairing mode, the below is the output (I changed the ip address below):

Name: RainMachine-00ce4a (2)._hap._tcp.local.
Url: http_impl://192.168.xx.xx:41977
Configuration number (c#): 2
Feature Flags (ff): 2 (Flag: 2)
Device ID (id): 38:B9:E8:8D:4F:D2
Model Name (md): SPK5 Pro
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Sprinkler (Id: 28)
Name: RainMachine-00ce4a._hap._tcp.local.
Url: http_impl://192.168.xx.xx:34565
Configuration number (c#): 2
Feature Flags (ff): 2 (Flag: 2)
Device ID (id): 38:B9:E8:8D:4F:D2
Model Name (md): SPK5 Pro
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has not been paired with any controllers. (Flag: 1)
Category Identifier (ci): Sprinkler (Id: 28)
Name: RainMachine-00ce4a._hap._tcp.local.
Url: http_impl://192.168.xx.xx:39911
Configuration number (c#): 2
Feature Flags (ff): 2 (Flag: 2)
Device ID (id): 38:B9:E8:8D:4F:D2
Model Name (md): SPK5 Pro
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has not been paired with any controllers. (Flag: 1)
Category Identifier (ci): Sprinkler (Id: 28)

Not sure why it shows 3 times, but that is the output. There is also one more entry for my HASS install, but I assume you don't need that so I didn't include it above.
Thanks!

@Jc2k - hope the info I provided is good enough. I see bachya created an entry for homekit based on this. Should I go ahead and close this issue or you need more info?
Once you confirm that you don't need more info I will go ahead and mount the device, as its still on my desk right now :)
Thanks!

Ah sorry @deemee! I have been tied up with a big change to homekit_controller to support push events (so motion events happen immediately etc). That's eaten my life for the past few weeks 😅
There is one more thing i would like to try if thats ok. Another user has a device that was failing to pair and that had an ff of 2 as well and it worked if we made changes i described in my earlier comments (https://github.com/home-assistant/core/issues/31745#issuecomment-590249028). We weren't able to try them with your device in the end, so i'd like to try them on the command line. Is that OK? Do you still have the venv environment we made with these commands?
python3 -m venv homekit_test
./homekit_test/bin/pip install aiohomekit[IP]
./homekit_test/bin/python -m aiohomekit discover_ip

If not can you get to that state again.
PS i have to go cook tea but will be back in a couple of hours.

I've pushed a branch with a tweak in i'd like to try:
 python3 -m venv homekit_test
./homekit_test/bin/pip install git+https://github.com/Jc2k/aiohomekit.git@pairing_changes
./homekit_test/bin/python -m aiohomekit discover_ip
echo '{}' > pairing.json
./homekit_test/bin/python -m aiohomekit pair_ip -f pairing.json -a rainmachine -d 38:B9:E8:8D:4F:D2

Replace the device id with the one from your current discover_ip output, if its changed.
It might take a minute, but let me know what it does.

Thanks @Jc2k . If possible please tag me when replying on this as I get an email only then, might be a bit faster for me to see it/respond :)
I am trying the new commands you send and I get no such file or dir error:

pi@raspberrypi:~ $ ./homekit_test/bin/pip install git+https://github.com/Jc2k/aiohomekit.git@pairing_changes
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting git+https://github.com/Jc2k/aiohomekit.git@pairing_changes
Cloning https://github.com/Jc2k/aiohomekit.git (to revision pairing_changes) to /tmp/pip-req-build-yuxeznn7
Branch 'pairing_changes' set up to track remote branch 'pairing_changes' from 'origin'.
Switched to a new branch 'pairing_changes'
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.7/tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-yuxeznn7/setup.py'
----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-yuxeznn7/

Thanks!

@deemee cheers. i get every e-mail, didn't know there was an option for less spam 😅 it works here, must be a python version thing? Ok, lets try:
pip install aiohomekit[IP]

as originally. but then you'll need to find aiohomekit/controller/ip/discovery.py and then make this change.

I guess I was getting the emails just didn't refresh properly, anyway :) thanks
OK - so if I understood right, in the homekit_test I ran the pip install aiohomekit[IP] and then modified the file as mentioned.
After that I ran the discover_ip command, right? Here is the ouput:
`pi@raspberrypi:~/homekit_test $ bin/python -m aiohomekit discover_ip
Name: Home Assistant Bridge._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:51827
Configuration number (c#): 2
Feature Flags (ff): 0 (Flag: 0)
Device ID (id): 48:4F:99:40:AC:1F
Model Name (md): Home Assistant Bridge
Protocol Version (pv): 1.0
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Bridge (Id: 2)
Name: RainMachine-00ce4a (2)._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:41977
Configuration number (c#): 2
Feature Flags (ff): 2 (Flag: 2)
Device ID (id): 38:B9:E8:8D:4F:D2
Model Name (md): SPK5 Pro
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Sprinkler (Id: 28)
Name: RainMachine-00ce4a._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:39911
Configuration number (c#): 2
Feature Flags (ff): 2 (Flag: 2)
Device ID (id): 38:B9:E8:8D:4F:D2
Model Name (md): SPK5 Pro
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has not been paired with any controllers. (Flag: 1)
Category Identifier (ci): Sprinkler (Id: 28)
`
And this is when I put the device in pairing mode - looks identical:
`
pi@raspberrypi:~/homekit_test $ bin/python -m aiohomekit discover_ip
Name: Home Assistant Bridge._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:51827
Configuration number (c#): 2
Feature Flags (ff): 0 (Flag: 0)
Device ID (id): 48:4F:99:40:AC:1F
Model Name (md): Home Assistant Bridge
Protocol Version (pv): 1.0
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Bridge (Id: 2)
Name: RainMachine-00ce4a (2)._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:41977
Configuration number (c#): 2
Feature Flags (ff): 2 (Flag: 2)
Device ID (id): 38:B9:E8:8D:4F:D2
Model Name (md): SPK5 Pro
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Sprinkler (Id: 28)
Name: RainMachine-00ce4a._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:41254
Configuration number (c#): 2
Feature Flags (ff): 2 (Flag: 2)
Device ID (id): 38:B9:E8:8D:4F:D2
Model Name (md): SPK5 Pro
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has not been paired with any controllers. (Flag: 1)
Category Identifier (ci): Sprinkler (Id: 28)
`
Thanks!

@deemee  And then if you pair with
echo '{}' > pairing.json
./homekit_test/bin/python -m aiohomekit pair_ip -f pairing.json -a rainmachine -d 38:B9:E8:8D:4F:D2

?

Gotcha - I misunderstood which command you meant.
OK - so I ran those 2 and I tried first to put the device in pairing mode and then run the command, but it doesn't finish, it just "hangs". Been more than 5mins, should I wait longer?
Then I tried to put the device in pairing mode once the command was already running:
pi@raspberrypi:~/homekit_test $ echo '{}' > pairing.json
pi@raspberrypi:~/homekit_test $ cd ..
pi@raspberrypi:~ $ echo '{}' > pairing.json
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit pair_ip -f pairing.json -a rainmachine -d 38:B9:E8:8D:4F:D2

Once I interrupted the process it exited with an error, not sure if any of this can be helpful:
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit pair_ip -f pairing.json -a rainmachine -d 38:B9:E8:8D:4F:D2
^C2020-03-14 21:56:17,358 __main__.py:0151 ERROR Error whilst pairing
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 571, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.7/selectors.py", line 468, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/__main__.py", line 145, in pair_ip
    finish_pairing = await discovery.start_pairing(args.alias)
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/discovery.py", line 61, in start_pairing
    await self._ensure_connected()
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/discovery.py", line 47, in _ensure_connected
    await self.connection.ensure_connection()
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 227, in ensure_connection
    await asyncio.shield(self._connector)
concurrent.futures._base.CancelledError
2020-03-14 21:56:17,445 base_events.py:1608 ERROR Task exception was never retrieved
future: <Task finished coro=<main() done, defined at /home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/__main__.py:416> exception=SystemExit(1)>
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 571, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.7/selectors.py", line 468, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/__main__.py", line 581, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.7/asyncio/runners.py", line 46, in run
    _cancel_all_tasks(loop)
  File "/usr/lib/python3.7/asyncio/runners.py", line 62, in _cancel_all_tasks
    tasks.gather(*to_cancel, loop=loop, return_exceptions=True))
  File "/usr/lib/python3.7/asyncio/base_events.py", line 571, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1775, in _run_once
    handle._run()
  File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/__main__.py", line 576, in main
    sys.exit(1)
SystemExit: 1
pi@raspberrypi:~ $ cat pairing.json
{}

Thanks!

@deemee what if you stick a "--level DEBUG" on the end of the pairing command?

I added just before the pair_ip as the other didn't work, hope that it was correct, anyway here is the output:
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit --log DEBUG pair_ip -f pairing.json -a rainmachine -d 38:B9:E8:8D:4F:D2
2020-03-14 22:16:10,609 __init__.py:0112 DEBUG candidate data {b'md': b'Home Assistant Bridge', b'pv': b'1.0', b'id': b'48:4F:99:40:AC:1F', b'c#': b'2', b's#': b'1', b'ff': b'0', b'ci': b'2', b'sf': b'0', b'sh': b'MjrpmQ=='}
2020-03-14 22:16:10,611 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'Home Assistant Bridge._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 51827, 'c#': '2', 'ff': 0, 'flags': <FeatureFlags.0: 0>, 'id': '48:4F:99:40:AC:1F', 'md': 'Home Assistant Bridge', 'pv': '1.0', 's#': '1', 'sf': '0', 'statusflags': 'Accessory has been paired.', 'ci': '2', 'category': 'Bridge'}
2020-03-14 22:16:10,612 __init__.py:0112 DEBUG candidate data {b'c#': b'2', b'ff': b'2', b'id': b'38:B9:E8:8D:4F:D2', b'md': b'SPK5 Pro', b'pv': b'1.1', b's#': b'1', b'sf': b'0', b'ci': b'28', b'sh': b'QQr3aw=='}
2020-03-14 22:16:10,612 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'RainMachine-00ce4a (2)._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 41977, 'c#': '2', 'ff': 2, 'flags': <FeatureFlags.SUPPORTS_SOFTWARE_AUTHENTICATION: 2>, 'id': '38:B9:E8:8D:4F:D2', 'md': 'SPK5 Pro', 'pv': '1.1', 's#': '1', 'sf': '0', 'statusflags': 'Accessory has been paired.', 'ci': '28', 'category': 'Sprinkler'}
2020-03-14 22:16:10,613 __init__.py:0112 DEBUG candidate data {b'c#': b'2', b'ff': b'2', b'id': b'38:B9:E8:8D:4F:D2', b'md': b'SPK5 Pro', b'pv': b'1.1', b's#': b'1', b'sf': b'1', b'ci': b'28', b'sh': b'QQr3aw=='}
2020-03-14 22:16:10,614 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'RainMachine-00ce4a._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 46629, 'c#': '2', 'ff': 2, 'flags': <FeatureFlags.SUPPORTS_SOFTWARE_AUTHENTICATION: 2>, 'id': '38:B9:E8:8D:4F:D2', 'md': 'SPK5 Pro', 'pv': '1.1', 's#': '1', 'sf': '1', 'statusflags': 'Accessory has not been paired with any controllers.', 'ci': '28', 'category': 'Sprinkler'}
2020-03-14 22:16:12,609 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:16:12,612 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 0 seconds
2020-03-14 22:16:13,364 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:16:13,367 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 0 seconds
2020-03-14 22:16:14,494 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:16:14,496 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 1 seconds
2020-03-14 22:16:16,187 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:16:16,190 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 1 seconds
2020-03-14 22:16:18,726 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:16:18,728 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 2 seconds
2020-03-14 22:16:22,530 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:16:22,532 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 3 seconds
2020-03-14 22:16:28,235 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:16:28,238 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 5 seconds
2020-03-14 22:16:36,792 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:16:36,794 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 8 seconds
2020-03-14 22:16:49,623 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:16:49,626 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 12 seconds
2020-03-14 22:17:08,868 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:17:08,871 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 19 seconds
2020-03-14 22:17:37,734 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:41977
2020-03-14 22:17:37,736 connection.py:0445 DEBUG Connecting to accessory failed. Retrying in 28 seconds

Oh yeah, your device is appearing in bonjour multiple times. That's really weird. And annoyingly aiohomekit is picking the "wrong" one. They are both on the same IP but as you can see the port changes. I've never seen something like that happen before. Have you reset the device at all? Do you have multiple subnets on your home network by any chance? Wondering if a multicast reflector is somehow caching bonjour records between restarts?

I did reset once few weeks back as I had some troubles, let me do it again now and see. I have multiple subnets on my network, but this should only be on one of them. It has both wifi and ethernet, I wonder if that could be the problem.
Anyway I started the factory reset now, let me see how it goes after that, I will report soon, if it is the same I will disconnect the wired connection and go on wifi only.
I will reply more soon :)

OK - now it seems to be working fine - I will paste everything here - hope its not too much or anything sensitive that could cause me problems. Please suggest if I need to remove anything, and what would be any next steps. Thanks :)
BTW the ID changed so I modified:
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit discover_ip
Name: Home Assistant Bridge._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:51827
Configuration number (c#): 2
Feature Flags (ff): 0 (Flag: 0)
Device ID (id): 48:4F:99:40:AC:1F
Model Name (md): Home Assistant Bridge
Protocol Version (pv): 1.0
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Bridge (Id: 2)

Name: RainMachine-00ce4a._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:40430
Configuration number (c#): 1
Feature Flags (ff): 2 (Flag: 2)
Device ID (id): E1:27:24:CA:15:42
Model Name (md): SPK5 Pro
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has not been paired with any controllers. (Flag: 1)
Category Identifier (ci): Sprinkler (Id: 28)

And then the pair with the new ID
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit --log DEBUG pair_ip -f pairing.json -a rainmachine -d E1:27:24:CA:15:42
2020-03-14 22:27:20,011 __init__.py:0112 DEBUG candidate data {b'md': b'Home Assistant Bridge', b'pv': b'1.0', b'id': b'48:4F:99:40:AC:1F', b'c#': b'2', b's#': b'1', b'ff': b'0', b'ci': b'2', b'sf': b'0', b'sh': b'MjrpmQ=='}
2020-03-14 22:27:20,012 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'Home Assistant Bridge._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 51827, 'c#': '2', 'ff': 0, 'flags': <FeatureFlags.0: 0>, 'id': '48:4F:99:40:AC:1F', 'md': 'Home Assistant Bridge', 'pv': '1.0', 's#': '1', 'sf': '0', 'statusflags': 'Accessory has been paired.', 'ci': '2', 'category': 'Bridge'}
2020-03-14 22:27:20,012 __init__.py:0112 DEBUG candidate data {b'c#': b'1', b'ff': b'2', b'id': b'E1:27:24:CA:15:42', b'md': b'SPK5 Pro', b'pv': b'1.1', b's#': b'1', b'sf': b'1', b'ci': b'28', b'sh': b'hyJhXg=='}
2020-03-14 22:27:20,013 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'RainMachine-00ce4a._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 40430, 'c#': '1', 'ff': 2, 'flags': <FeatureFlags.SUPPORTS_SOFTWARE_AUTHENTICATION: 2>, 'id': 'E1:27:24:CA:15:42', 'md': 'SPK5 Pro', 'pv': '1.1', 's#': '1', 'sf': '1', 'statusflags': 'Accessory has not been paired with any controllers.', 'ci': '28', 'category': 'Sprinkler'}
2020-03-14 22:27:22,010 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:40430
2020-03-14 22:27:22,013 __init__.py:0123 DEBUG #1 ios -> accessory: send SRP start request
2020-03-14 22:27:22,014 tlv.py:0142 DEBUG sending [
  6: (1 bytes/<class 'bytearray'>) 0x01
  0: (1 bytes/<class 'bytearray'>) 0x00
]

2020-03-14 22:27:22,689 tlv.py:0125 DEBUG receiving [
  6: (1 bytes/<class 'bytearray'>) 0x02
  3: (384 bytes/<class 'bytearray'>) 0xfc3e7b9b287fbbc509d73a613c4f58b0513b05448f417a10e9fc48fba65279997c30c71c4b3c1848cce0bf4465fa3e63ef9b316fcaa855a8c2c2764970c39ae4981bcd0335cd24c649ded2bee89ebad9b11e86b25c6eb2ce1f31430ae02f6ae5a6d71d034b99aec14ad1d7661d0a0ce0821833b5dcc5fd8490381ffea358c36aeefadbdedf42c0463732dc830802a208bda0673d0906eb26f5aeb607d469ad5e805d9433b476ab8a2a8784920c7f45d63d7647bd8494e92b43651cc03ada240acf3ece265ee6fa55e31b3fb8c6539e53e63895d39f49cb41078db0aab8bf176178c5cc99a8baae3935fe09c698ffe918ddb18c5e0774ec227f2973eaf2353b084d2629948f68f9920e05d70cfda4b0725d3b76fc27e612822827b0b309095b247f4596853b1985fb440451ab5d5786d99b63a650c82db79fd6024f9a3903b54c72905a846f2ca86e764babdd31e183fbddfe57dd78328a09f1c2a80fa84044f35d7df928dda66cebbc0b39b3dae711e150b1fdd1f4635310e7c3dbd0425db0c1
  2: (16 bytes/<class 'bytearray'>) 0x39cc67d427d4ae99d1196b99e6c9629d
]

2020-03-14 22:27:22,690 __init__.py:0140 DEBUG #3 ios -> accessory: send SRP verify request
Enter device pin (XXX-YY-ZZZ): 275-64-086
2020-03-14 22:27:45,640 tlv.py:0142 DEBUG sending [
  6: (1 bytes/<class 'bytearray'>) 0x03
  3: (384 bytes/<class 'bytearray'>) 0x3871dcf96cf8ce24a842e0d727cafefea003fc7642d5dbf3548c2f92c05f796fa4513e29bce27a5ec73af06d2980ce61b5cb0cc7831ff0c26d78c1a425a7e44376a5d880e3c23a1bd3686bdfae4acd61d27dc1e5efe5381c8ea09c7719ee5eba8120da6f3a56bdf6b5a8ec2144e66c2a714f9508078c5a25ce1d38a0a1d51339515d74c59d336160b09bd5a6099b54ec25ab6c6078f80ac073709da08f689b4ce8ac2331ae140707af2052eeb9221f22b06a393b78371c177147f66e49a4110b3e4cae18dc953d8f3aa6d68111b47595a82b1a3640b0ea62d4f462fbfc620be04956cb74905e45c4b88f82a0951ab703aed14b2d676baafb778293ee4c6636bea151470752350882833d46c4e1c99b894e94d10620391e48cb0b3170a19f1e3767a9fcfbfff9e400755a3b23f2d518b62125436d709272250cee1e864224a9c3b1155bfb9aa08613b96fcefe3d67a09a1e5f42e06c8bd851245a55dc03566fe51e6f649073797c22bd67c6defaca51e84e52ab2a097a8db9dfdfd8edf3dbccd3
  4: (64 bytes/<class 'bytearray'>) 0x61773ee8e6b04505b4858138c3f1bce686388eb185de6a04a07749523ac1156dec70d22bdc76218f41e6227080e82c2ec3ea3a3c14b890aa8337adea80a0278d
]

2020-03-14 22:27:46,344 tlv.py:0125 DEBUG receiving [
  6: (1 bytes/<class 'bytearray'>) 0x04
  4: (64 bytes/<class 'bytearray'>) 0x3a189279d4aa3e40d0af2cccdae7e5967b67caeb6d9d9f71fa6e5583168f472e8f48d86a4b88efac3fc3eaa61ad87def514925a9049adb2dc4391dc66c9c6f0c
]

2020-03-14 22:27:46,345 __init__.py:0196 DEBUG #5 ios -> accessory: send SRP exchange request
2020-03-14 22:27:47,388 tlv.py:0142 DEBUG sending [
  1: (36 bytes/<class 'bytes'>) b'dd007fbe-9404-4c82-94dc-9b2c4b2ac609'
  3: (32 bytes/<class 'bytes'>) b'\xbe\x19\xc4\x19\x04\r\x1d\xd7\x1f\x08\xcf\xb0\xbf\xa7N\xc8\x01\xfc\xf5t\x1c1\xba\x9d\xfe\xcd\xfd\xb9\x06\x1a\xc1\xd3'
  10: (64 bytes/<class 'bytes'>) b'\x1f\xc7&\xd2\xbf<\x87\x10J\x1a\xee\x0e\xb6\x8dU\xe3A\x16\xe3O\xca\xbb\x12`\x84\xf0\xc7\xec\xcb\t;\xc6&N\x85\xaf\x07\xfb)C\xf27w\x90\x8e1\x9aL#y\xeev=\xbe\x0f\xe4\x18\xbaG\xc4,<J\x01'
]

2020-03-14 22:27:47,389 tlv.py:0142 DEBUG sending [
  6: (1 bytes/<class 'bytearray'>) 0x05
  5: (154 bytes/<class 'bytes'>) b';\x9a\x99x\xca\x199t\xe2w^\x85Sd3Cow`\x1az\xfd\xf2\x10\xba(\xeb2\x1c\xcd\x91\x1537\xb1\xd9\x94b\xee\xd7\x1c\xae\x80\x14\xb7\xfeo\xd7R\xbc:h\'\xba\x98.\x81\xeb\xd0m\xa86\xa0k\x9e\xe6\x1b\xd1w2\xa6\xe7\xd7}\x95\xa3\xc1\x8dJ\xb0vQ\xfb\xf0\x86C\xd4\xc9X^(\xc6\xc2y\xc2\xec\xc6\xa4\\\xbd0\xa1\x8e\xd0j\x81\xd9a6\xe1v\x87\x1e\x92\x12\x93l\x15\xa3\x81\xc1\xbe\xee\xd9\xaem\xc9\xa0\x07\xf3psuM[T\xfe"\x02\xb9\xbd\xe6W:w\xe1r\xd7\x11:V\x9bO&'
]

2020-03-14 22:27:47,430 tlv.py:0125 DEBUG receiving [
  6: (1 bytes/<class 'bytearray'>) 0x06
  5: (135 bytes/<class 'bytearray'>) 0x1ec0db0ccb118e9fc862532eb55cab817928ff0bfaba0f7fb0685346b8a78cdb8e7b310944d0a12777eaf9393af483c24046a9794487ab4a4ee22a32e3b1dae9514afa332930eba95dd941b5d5ba7c69ec9e0fe3798f460ff3f15da7e64fbae905435370228dd382f32fe25b2a6b70d7c8e4ffcb9f9fd4f893ec3d3d7045d120e2bd335b32242b
]

2020-03-14 22:27:47,430 tlv.py:0125 DEBUG receiving [
  1: (17 bytes/<class 'bytearray'>) 0x45313a32373a32343a43413a31353a3432
  3: (32 bytes/<class 'bytearray'>) 0x01da87f2b6f79f8c12ed305e9d7323e67dc5ca5546a3b8ae2f4b1bd684024a80
  10: (64 bytes/<class 'bytearray'>) 0x70ce592a3419c89e2374691daa3e0f0360a3584a9559afccba9c3a65de6af6ecf4849436637b3cf69d39f40f507865b6c1dd8503cd0939aa0562be1288540509
]

2020-03-14 22:27:47,767 connection.py:0392 DEBUG Connection HomeKitConnection(host='<IP_ADDRESS>', port=40430) lost.
2020-03-14 22:27:47,768 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:40430
2020-03-14 22:27:47,770 tlv.py:0142 DEBUG sending [
  6: (1 bytes/<class 'bytearray'>) 0x01
  3: (32 bytes/<class 'bytes'>) b"\x14\xc2\x8ag5\xcb\x88VV#\xb4V\xe6\x7f\xcdfQ'\x1e\x92\xec^\x87\x8f&f\xd3\x83\xce\x13\xb3!"
]

2020-03-14 22:27:47,797 tlv.py:0125 DEBUG receiving [
  6: (1 bytes/<class 'bytearray'>) 0x02
  3: (32 bytes/<class 'bytearray'>) 0x73c9db995c76e9cdda29968a7fdef6a3dcd306857a54f837a11da7b1171cc321
  5: (101 bytes/<class 'bytearray'>) 0xcbc0bb913146a28bb1befb04f79142be7193d47b0f14f26161d2904fc851511fa8a657f1ae9569298367bc9ca18fb7f4ed2f55e168d2ff92cd3df9f92236ecfc3408e362b387fd0c39db9c9920aa6475e69b84ba3f9a908ff476a9194528907180e64c8de0
]

2020-03-14 22:27:47,798 tlv.py:0125 DEBUG receiving [
  1: (17 bytes/<class 'bytearray'>) 0x45313a32373a32343a43413a31353a3432
  10: (64 bytes/<class 'bytearray'>) 0x5d3891bef73b6abb56d33f017eb29a5e4364409fd75300d5feb52aefcab083e643d851591677cfeba9ddff1b237f8dc4392be357ad326f2b00193130b6c9a201
]

2020-03-14 22:27:47,800 tlv.py:0142 DEBUG sending [
  1: (36 bytes/<class 'bytes'>) b'dd007fbe-9404-4c82-94dc-9b2c4b2ac609'
  10: (64 bytes/<class 'bytes'>) b'\xa2\x98\xfdE\xd4\xb3\x88\xea\xcb\xa3\x92\x0ff>\xe9H\xbd_\xba\xb6\xc6G\xadr\x0c\x97\xbe\xf4#\x80_\xe3\x0f\xcb\x1d\x03\x84\xee\xef\xa5S\xaa\xb9S\x91\x1b\xe5m\x94\x9c;\x04\xbd?\x17\x8e-\x0b\xff\xf6\xb8`_\x06'
]

2020-03-14 22:27:47,800 tlv.py:0142 DEBUG sending [
  6: (1 bytes/<class 'bytearray'>) 0x03
  5: (120 bytes/<class 'bytes'>) b'\xa9yl:\xa3\xc5\xc2\xa8\x8bB~-\xb7\xbbp\xa9#Am\xe6\xeb\x1e\xf0\xcc\xa5\xd80\x99\x854\xf2R\x95B%|\x9d\xfeg:l2"nG%\xa3\xf1\x18!m\x9f{^s\x96\x11\x8d\x8e\x12i\xab\xdfT\x1cM}v{\xb4CiXA\r\xbb+\x0b\xc9\xd9\x01\x8f*7\x89\x1e\x06Z`\x08\xef\xd8\xdd\x926\x0f\x95:\xbbA\xc1<>|]o)\x04\x08\xf4s\xc4\xf5\xd9\xc9\xb6\x9c\x9e\xb5\x05'
]

2020-03-14 22:27:47,820 tlv.py:0125 DEBUG receiving [
  6: (1 bytes/<class 'bytearray'>) 0x04
]

2020-03-14 22:27:47,821 connection.py:0514 DEBUG Secure connection to <IP_ADDRESS>:40430 established
Pairing for "rainmachine" was established.

@deemee Very weird, wonder what was causing the ghost bonjour dns entries...
Great news that it worked. Can you possibly send me your pairing.json? I'm on HA discord or keybase if you want to send it out of band. I'm expecting it to have a bunch of keys like "services" and "characteristics". Thats the data i can use to teach homekit_controller about sprinklers.
After that delete your pairing.json, reset your sprinkler, and undo the change you made to aiohomekit/controller/ip/discovery.py. Then see if it pairs a second time. Wondering if the change was needed at all, and if it was the ghost bonjour problem all along...
And thank you for your help with this so far!

Thanks @Jc2k I cant seem to find you on discord so I uploaded it on Firefox send - hope you can download it - https://send.firefox.com/download/cb1939db38057053/#C9z2rIxK9_olSC7b6UA2TA
I will try the other stuff shortly, have some things to do around the house. Thanks for all the help so far - I will report more shortly.

@deemee Nice one. Got it thanks. Has the data i need too! It's late here so i'll probably not get chance to look at it today now.

OK - I did make the changes as suggested above and it doesn't seem to work, this is what I did:
I updated the discovery.py file and changed the with_auth back to True, I factory reset my device, I removed the pairings.json (and then recreated it with {} as it errored out). Once I ran the pairing command it asked for the homekit key and I entered but it errored out.
First, the discovery to check the new ID:
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit discover_ip
Name: Home Assistant Bridge._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:51827
Configuration number (c#): 2
Feature Flags (ff): 0 (Flag: 0)
Device ID (id): 48:4F:99:40:AC:1F
Model Name (md): Home Assistant Bridge
Protocol Version (pv): 1.0
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Bridge (Id: 2)

Name: RainMachine-00ce4a._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:32825
Configuration number (c#): 1
Feature Flags (ff): 2 (Flag: 2)
Device ID (id): 5D:A0:94:EF:97:EE
Model Name (md): SPK5 Pro
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has not been paired with any controllers. (Flag: 1)
Category Identifier (ci): Sprinkler (Id: 28)

Here is the first pair with the homekit pin:
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit --log DEBUG pair_ip -f pairing.json -a rainmachine -d 5D:A0:94:EF:97:EE
2020-03-15 00:43:08,708 __init__.py:0112 DEBUG candidate data {b'md': b'Home Assistant Bridge', b'pv': b'1.0', b'id': b'48:4F:99:40:AC:1F', b'c#': b'2', b's#': b'1', b'ff': b'0', b'ci': b'2', b'sf': b'0', b'sh': b'MjrpmQ=='}
2020-03-15 00:43:08,710 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'Home Assistant Bridge._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 51827, 'c#': '2', 'ff': 0, 'flags': <FeatureFlags.0: 0>, 'id': '48:4F:99:40:AC:1F', 'md': 'Home Assistant Bridge', 'pv': '1.0', 's#': '1', 'sf': '0', 'statusflags': 'Accessory has been paired.', 'ci': '2', 'category': 'Bridge'}
2020-03-15 00:43:08,710 __init__.py:0112 DEBUG candidate data {b'c#': b'1', b'ff': b'2', b'id': b'5D:A0:94:EF:97:EE', b'md': b'SPK5 Pro', b'pv': b'1.1', b's#': b'1', b'sf': b'1', b'ci': b'28', b'sh': b'4YfyOA=='}
2020-03-15 00:43:08,711 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'RainMachine-00ce4a._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 32825, 'c#': '1', 'ff': 2, 'flags': <FeatureFlags.SUPPORTS_SOFTWARE_AUTHENTICATION: 2>, 'id': '5D:A0:94:EF:97:EE', 'md': 'SPK5 Pro', 'pv': '1.1', 's#': '1', 'sf': '1', 'statusflags': 'Accessory has not been paired with any controllers.', 'ci': '28', 'category': 'Sprinkler'}
2020-03-15 00:43:11,831 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:32825
2020-03-15 00:43:11,835 __init__.py:0123 DEBUG #1 ios -> accessory: send SRP start request
2020-03-15 00:43:11,836 tlv.py:0142 DEBUG sending [
  6: (1 bytes/<class 'bytearray'>) 0x01
  0: (1 bytes/<class 'bytearray'>) 0x01
]

2020-03-15 00:43:12,482 tlv.py:0125 DEBUG receiving [
  6: (1 bytes/<class 'bytearray'>) 0x02
  3: (384 bytes/<class 'bytearray'>) 0xfe2e4984331e8fe7bf8b9515459e038692c839d449018b0ef56051259e804245426dfa5c871e7eb5ac7af7b2cbd6b4921b132e5cdba39fd2bc5804b9fe5fc4cffe2d6b2137c1dc3026bec77e14df997835c16c65756eb429c858282bb3b382f2d9413bc61f6b941b1e1c24021dac10512816c100057ffeb25595582dd2d2d131c132ec9710568c93a5236946518880ab2857e9b2cc17adec604797c4ac9ef64c9d02b39ac97e6fe7087fae0e93d5b2cfbb69ce05dd87161e3c0ba4f649d45adce95d2b28b66f0f488fb04037fe83633008c46a977e1b062ceb536a1f8ce7a0edfe522246fc7a62aa1226a4ad06b34015fcd1912d2a9b64a05e6451bed54de3d71f84aa81869aea58d4996ff1c145b1f30e8f795bd06e4e0f3170dd1f76cfa863dcf0251f137f59d01f39bb710e3ed0969fdf886f701df1c50c501fe2b35dbb042ed02ed733363c1a8d37bae3f3f4f34d54b369db3746a63ba4394bd4a45e2e1daff6ec8447561326c8c30bdc7ccdc02eabfdc8a9212576952ce3d0f34d04b40c
  2: (16 bytes/<class 'bytearray'>) 0xab4480bce9d583078f24ad760d7b0977
]

2020-03-15 00:43:12,483 __init__.py:0140 DEBUG #3 ios -> accessory: send SRP verify request
Enter device pin (XXX-YY-ZZZ): 358-59-269
2020-03-15 00:43:31,620 tlv.py:0142 DEBUG sending [
  6: (1 bytes/<class 'bytearray'>) 0x03
  3: (384 bytes/<class 'bytearray'>) 0x11b7ead9d629d4a60b73b358ce2d849eb1012826bda3e55a2cd2f9d241557c046f27591a1a5a5c85d8fe2e59a9ccc95e77b007c8d431a1734cd2f4941a2cdbedfc1da78f4f7a917069c7e9bce7bbee16466dd601dedd14c5f0c2490ddaf99778ce2e78b823a43972151aaf24ced2c26209832e759890b013ab5d8cc08300f03fd364bcc6b78780575e982e8b6cdccdc3bf4045d0409107fcdd5f1546f152f50fcb0a0ce6d707cb5a3646d7fffa0ce3328507bcbdefd468cdaa1b699d1de9faf3055c95e0fac3493979860ec0cd427d0fa15343a26e6c0745f1cb7f484f3bdc42e9f0920c26a74459281023e8ce840b406dc2176392c61ff0be6b866484e41864f60a320ac669d7ba1ded10e0a4f68c38ba2041aebc83d589dba6b0cd82e5cc8c1fc31c9ebc8e06077fd3a122faa16025f483edcb47f9cb27d1aa5ac82c5e7afdcdd981f97350233ca9e7a4b8ee87379606e54f51f8deaf686879955cb8fd9b138a5233da0f134ae804908613ab923349e2551f0876d43503cdee48bea539a7e4
  4: (64 bytes/<class 'bytearray'>) 0x1fa29b6af45ed3cfd3d489ddd550b9420ce89f0ba833d0cc4eb65a5104dc4fee353715ed436dbc17d2bc0e3c1041fb87779f37dbeb575c6e4c543584f56f13d4
]

2020-03-15 00:43:32,336 connection.py:0392 DEBUG Connection HomeKitConnection(host='<IP_ADDRESS>', port=32825) lost.
2020-03-15 00:43:32,336 __main__.py:0151 ERROR Error whilst pairing
Traceback (most recent call last):
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/__main__.py", line 146, in pair_ip
    pairing = await finish_pairing(pin_function())
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/discovery.py", line 93, in finish_pairing
    "/pair-setup", body=request, expected=expected,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 325, in post_tlv
    target, TLV.encode_list(body), content_type=HttpContentTypes.TLV,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 295, in post
    body=body,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 371, in request
    return await self.protocol.send_bytes(request_bytes)
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 73, in send_bytes
    return await asyncio.wait_for(result, 10)
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
aiohomekit.exceptions.AccessoryDisconnectedError: Connection closed

Then I tried to run it again, but it just fails with the below, doesn't trigger the pairing on my device:
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit --log DEBUG pair_ip -f pairing.json -a rainmachine -d 5D:A0:94:EF:97:EE
2020-03-15 00:44:07,850 __init__.py:0112 DEBUG candidate data {b'md': b'Home Assistant Bridge', b'pv': b'1.0', b'id': b'48:4F:99:40:AC:1F', b'c#': b'2', b's#': b'1', b'ff': b'0', b'ci': b'2', b'sf': b'0', b'sh': b'MjrpmQ=='}
2020-03-15 00:44:07,851 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'Home Assistant Bridge._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 51827, 'c#': '2', 'ff': 0, 'flags': <FeatureFlags.0: 0>, 'id': '48:4F:99:40:AC:1F', 'md': 'Home Assistant Bridge', 'pv': '1.0', 's#': '1', 'sf': '0', 'statusflags': 'Accessory has been paired.', 'ci': '2', 'category': 'Bridge'}
2020-03-15 00:44:07,851 __init__.py:0112 DEBUG candidate data {b'c#': b'1', b'ff': b'2', b'id': b'5D:A0:94:EF:97:EE', b'md': b'SPK5 Pro', b'pv': b'1.1', b's#': b'1', b'sf': b'1', b'ci': b'28', b'sh': b'4YfyOA=='}
2020-03-15 00:44:07,852 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'RainMachine-00ce4a._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 32825, 'c#': '1', 'ff': 2, 'flags': <FeatureFlags.SUPPORTS_SOFTWARE_AUTHENTICATION: 2>, 'id': '5D:A0:94:EF:97:EE', 'md': 'SPK5 Pro', 'pv': '1.1', 's#': '1', 'sf': '1', 'statusflags': 'Accessory has not been paired with any controllers.', 'ci': '28', 'category': 'Sprinkler'}
2020-03-15 00:44:09,849 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:32825
2020-03-15 00:44:09,852 __init__.py:0123 DEBUG #1 ios -> accessory: send SRP start request
2020-03-15 00:44:09,853 tlv.py:0142 DEBUG sending [
  6: (1 bytes/<class 'bytearray'>) 0x01
  0: (1 bytes/<class 'bytearray'>) 0x01
]

2020-03-15 00:44:19,865 __main__.py:0151 ERROR Error whilst pairing
Traceback (most recent call last):
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 73, in send_bytes
    return await asyncio.wait_for(result, 10)
  File "/usr/lib/python3.7/asyncio/tasks.py", line 423, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/__main__.py", line 145, in pair_ip
    finish_pairing = await discovery.start_pairing(args.alias)
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/discovery.py", line 74, in start_pairing
    "/pair-setup", body=request, expected=expected,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 325, in post_tlv
    target, TLV.encode_list(body), content_type=HttpContentTypes.TLV,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 295, in post
    body=body,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 371, in request
    return await self.protocol.send_bytes(request_bytes)
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 77, in send_bytes
    raise AccessoryDisconnectedError("Timeout while waiting for response")
aiohomekit.exceptions.AccessoryDisconnectedError: Timeout while waiting for response
2020-03-15 00:44:19,873 connection.py:0392 DEBUG Connection HomeKitConnection(host='<IP_ADDRESS>', port=32825) lost.
2020-03-15 00:44:19,874 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:32825
2020-03-15 00:44:19,901 base_events.py:1608 ERROR Task was destroyed but it is pending!
task: <Task pending coro=<BaseEventLoop.create_connection() running at /usr/lib/python3.7/asyncio/base_events.py:863> cb=[_release_waiter(<Future pendi...xb5b4aeb0>()]>)() at /usr/lib/python3.7/asyncio/tasks.py:366]>
sys:1: RuntimeWarning: coroutine 'BaseEventLoop.create_connection' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2020-03-15 00:44:19,918 base_events.py:1608 ERROR Task was destroyed but it is pending!
task: <Task pending coro=<HomeKitConnection._reconnect() done, defined at /home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py:425> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0xb5b4aeb0>()]> cb=[HomeKitConnection.start_connector.<locals>.done_callback() at /home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py:210]>

The discovery looks identical after the above and still shows it as unpaired.
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit discover_ip
Name: Home Assistant Bridge._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:51827
Configuration number (c#): 2
Feature Flags (ff): 0 (Flag: 0)
Device ID (id): 48:4F:99:40:AC:1F
Model Name (md): Home Assistant Bridge
Protocol Version (pv): 1.0
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Bridge (Id: 2)

Name: RainMachine-00ce4a._hap._tcp.local.
Url: http_impl://<IP_ADDRESS>:32825
Configuration number (c#): 1
Feature Flags (ff): 2 (Flag: 2)
Device ID (id): 5D:A0:94:EF:97:EE
Model Name (md): SPK5 Pro
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has not been paired with any controllers. (Flag: 1)
Category Identifier (ci): Sprinkler (Id: 28)

Thank you very much for the patience and being so helpful, let me know if you would like me to try anything else :) Cheers!

OK that seems to confirm that the change is needed for pairing to work. It would be great if you could apply the change again, and pair one more time to prove its not just dumb luck...

I changed the discovery.py file and retried - without doing any factory reset on my device and it doesn't work:
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit --log DEBUG pair_ip -f pairing.json -a rainmachine -d 5D:A0:94:EF:97:EE
2020-03-15 23:27:11,679 __init__.py:0112 DEBUG candidate data {b'md': b'Home Assistant Bridge', b'pv': b'1.0', b'id': b'48:4F:99:40:AC:1F', b'c#': b'2', b's#': b'1', b'ff': b'0', b'ci': b'2', b'sf': b'0', b'sh': b'MjrpmQ=='}
2020-03-15 23:27:11,681 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'Home Assistant Bridge._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 51827, 'c#': '2', 'ff': 0, 'flags': <FeatureFlags.0: 0>, 'id': '48:4F:99:40:AC:1F', 'md': 'Home Assistant Bridge', 'pv': '1.0', 's#': '1', 'sf': '0', 'statusflags': 'Accessory has been paired.', 'ci': '2', 'category': 'Bridge'}
2020-03-15 23:27:11,681 __init__.py:0112 DEBUG candidate data {b'c#': b'1', b'ff': b'2', b'id': b'5D:A0:94:EF:97:EE', b'md': b'SPK5 Pro', b'pv': b'1.1', b's#': b'1', b'sf': b'1', b'ci': b'28', b'sh': b'4YfyOA=='}
2020-03-15 23:27:11,682 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'RainMachine-00ce4a._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 32825, 'c#': '1', 'ff': 2, 'flags': <FeatureFlags.SUPPORTS_SOFTWARE_AUTHENTICATION: 2>, 'id': '5D:A0:94:EF:97:EE', 'md': 'SPK5 Pro', 'pv': '1.1', 's#': '1', 'sf': '1', 'statusflags': 'Accessory has not been paired with any controllers.', 'ci': '28', 'category': 'Sprinkler'}
2020-03-15 23:27:13,678 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:32825
2020-03-15 23:27:13,682 __init__.py:0123 DEBUG #1 ios -> accessory: send SRP start request
2020-03-15 23:27:13,682 tlv.py:0142 DEBUG sending [
  6: (1 bytes/<class 'bytearray'>) 0x01
  0: (1 bytes/<class 'bytearray'>) 0x00
]

2020-03-15 23:27:23,695 __main__.py:0151 ERROR Error whilst pairing
Traceback (most recent call last):
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 73, in send_bytes
    return await asyncio.wait_for(result, 10)
  File "/usr/lib/python3.7/asyncio/tasks.py", line 423, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/__main__.py", line 145, in pair_ip
    finish_pairing = await discovery.start_pairing(args.alias)
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/discovery.py", line 74, in start_pairing
    "/pair-setup", body=request, expected=expected,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 325, in post_tlv
    target, TLV.encode_list(body), content_type=HttpContentTypes.TLV,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 295, in post
    body=body,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 371, in request
    return await self.protocol.send_bytes(request_bytes)
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 77, in send_bytes
    raise AccessoryDisconnectedError("Timeout while waiting for response")
aiohomekit.exceptions.AccessoryDisconnectedError: Timeout while waiting for response
2020-03-15 23:27:23,702 connection.py:0392 DEBUG Connection HomeKitConnection(host='<IP_ADDRESS>', port=32825) lost.
2020-03-15 23:27:23,703 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:32825
2020-03-15 23:27:23,730 base_events.py:1608 ERROR Task was destroyed but it is pending!
task: <Task pending coro=<BaseEventLoop.create_connection() running at /usr/lib/python3.7/asyncio/base_events.py:863> cb=[_release_waiter(<Future pendi...xb5b86e10>()]>)() at /usr/lib/python3.7/asyncio/tasks.py:366]>
sys:1: RuntimeWarning: coroutine 'BaseEventLoop.create_connection' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2020-03-15 23:27:23,745 base_events.py:1608 ERROR Task was destroyed but it is pending!
task: <Task pending coro=<HomeKitConnection._reconnect() done, defined at /home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py:425> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0xb5b86e10>()]> cb=[HomeKitConnection.start_connector.<locals>.done_callback() at /home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py:210]>

I also removed any pairings on my device if there might've been any. Tried again and the same.
Then I Factory Reset my device again and tried with the option changed to False and it worked. I am not going to paste that here as it is similar to what I pasted above.
After all this, I factory reset again and changed the with_auth back to True and it failed again, this time though it failed before it even asked for the pairing key. It just blinked on my device and it timed out. Not sure if the wait period needs to be extended? Here is the output for the second time with True:
pi@raspberrypi:~ $ ./homekit_test/bin/python -m aiohomekit --log DEBUG pair_ip -f pairing.json -a rainmachine -d 5F:8D:B2:EE:30:C1
2020-03-15 23:39:00,511 __init__.py:0112 DEBUG candidate data {b'md': b'Home Assistant Bridge', b'pv': b'1.0', b'id': b'48:4F:99:40:AC:1F', b'c#': b'2', b's#': b'1', b'ff': b'0', b'ci': b'2', b'sf': b'0', b'sh': b'MjrpmQ=='}
2020-03-15 23:39:00,513 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'Home Assistant Bridge._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 51827, 'c#': '2', 'ff': 0, 'flags': <FeatureFlags.0: 0>, 'id': '48:4F:99:40:AC:1F', 'md': 'Home Assistant Bridge', 'pv': '1.0', 's#': '1', 'sf': '0', 'statusflags': 'Accessory has been paired.', 'ci': '2', 'category': 'Bridge'}
2020-03-15 23:39:00,513 __init__.py:0112 DEBUG candidate data {b'c#': b'1', b'ff': b'2', b'id': b'5F:8D:B2:EE:30:C1', b'md': b'SPK5 Pro', b'pv': b'1.1', b's#': b'1', b'sf': b'1', b'ci': b'28', b'sh': b'CAHhCA=='}
2020-03-15 23:39:00,514 __init__.py:0120 DEBUG found Homekit IP accessory {'name': 'RainMachine-00ce4a._hap._tcp.local.', 'address': '<IP_ADDRESS>', 'port': 34995, 'c#': '1', 'ff': 2, 'flags': <FeatureFlags.SUPPORTS_SOFTWARE_AUTHENTICATION: 2>, 'id': '5F:8D:B2:EE:30:C1', 'md': 'SPK5 Pro', 'pv': '1.1', 's#': '1', 'sf': '1', 'statusflags': 'Accessory has not been paired with any controllers.', 'ci': '28', 'category': 'Sprinkler'}
2020-03-15 23:39:04,950 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:34995
2020-03-15 23:39:04,953 __init__.py:0123 DEBUG #1 ios -> accessory: send SRP start request
2020-03-15 23:39:04,954 tlv.py:0142 DEBUG sending [
  6: (1 bytes/<class 'bytearray'>) 0x01
  0: (1 bytes/<class 'bytearray'>) 0x01
]

2020-03-15 23:39:14,965 __main__.py:0151 ERROR Error whilst pairing
Traceback (most recent call last):
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 73, in send_bytes
    return await asyncio.wait_for(result, 10)
  File "/usr/lib/python3.7/asyncio/tasks.py", line 423, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/__main__.py", line 145, in pair_ip
    finish_pairing = await discovery.start_pairing(args.alias)
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/discovery.py", line 74, in start_pairing
    "/pair-setup", body=request, expected=expected,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 325, in post_tlv
    target, TLV.encode_list(body), content_type=HttpContentTypes.TLV,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 295, in post
    body=body,
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 371, in request
    return await self.protocol.send_bytes(request_bytes)
  File "/home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py", line 77, in send_bytes
    raise AccessoryDisconnectedError("Timeout while waiting for response")
aiohomekit.exceptions.AccessoryDisconnectedError: Timeout while waiting for response
2020-03-15 23:39:14,972 connection.py:0392 DEBUG Connection HomeKitConnection(host='<IP_ADDRESS>', port=34995) lost.
2020-03-15 23:39:14,973 connection.py:0406 DEBUG Attempting connection to <IP_ADDRESS>:34995
2020-03-15 23:39:15,000 base_events.py:1608 ERROR Task was destroyed but it is pending!
task: <Task pending coro=<BaseEventLoop.create_connection() running at /usr/lib/python3.7/asyncio/base_events.py:863> cb=[_release_waiter(<Future pendi...xb5b34b70>()]>)() at /usr/lib/python3.7/asyncio/tasks.py:366]>
sys:1: RuntimeWarning: coroutine 'BaseEventLoop.create_connection' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2020-03-15 23:39:15,014 base_events.py:1608 ERROR Task was destroyed but it is pending!
task: <Task pending coro=<HomeKitConnection._reconnect() done, defined at /home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py:425> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0xb5b34b70>()]> cb=[HomeKitConnection.start_connector.<locals>.done_callback() at /home/pi/homekit_test/lib/python3.7/site-packages/aiohomekit/controller/ip/connection.py:210]>

Thanks!

Cheers @deemee! I think some of these are ultimately because of us confusing homekit on the device by requesting the wrong pairing type, and if we always send the right pairing type then it does work "from fresh".
I've put together a branch of homekit_controller that has very basic support for HomeKit irrigation systems and should pair first time for devices with an ff of 2. So on behalf of future HA users that don't have an integration as fully featured as rainbirds, thank you!
For anyone reading this ticket in future, rainmachine is a local polling integration so there isn't much of an advantage to homekit_controller for those users. Whilst homekit_controller has push support, its not like an irrigation system has motion sensors!

Thank you so much @Jc2k for all your help and patience! I will go ahead and close this - please let me know if you want me to test anything else. Stay safe my friend!!
I will probably just end up using the HASS integration instead of the homekit one as I don't see many benefits as of now. Cheers!


Bug: Second argument of sendTo as a plain object causes typescript error

XState version
XState version 5
Description
This was discussed on discord: https://discord.com/channels/795785288994652170/1201264941223645366/1201264941223645366
And now, as suggested the issue.
Having a plain object as second argument of sendTo function in a state machine causes a typescript error:
someEvent: {
          actions: sendTo(({ system }) => system.get('childMachine'), ({
            type: 'notify',
            data: 'error', // ts error
          })),
        },

this works, if it is a function
  someOtherEvent: {
          actions: sendTo(({ system }) => system.get('childMachine'), () => ({
            type: 'notify',
            data: 'thats working', // no ts error
          })),
        },

Expected result
no ts error
Actual result
ts error:
Object literal may only specify known properties, and 'data' does not exist in type 'EventObject | SendExpr<MachineContext, EventObject, undefined, { type: string; } & EventObject, EventObject>'.(2353)
Reproduction
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgYygUwIYzQWQ8gC2ADs0AaOAZzRgFcwLKwMB3YgYSIBsATRtYjwAqEOAF84AMygQQcAEQAPSjCxp5AbgBQW5BGIqU3HnkIk0cALxUa9ABQItcODACeYNJQBciJ87hoAG4CMN6IEhiUvv7+bh4+8pSyaACiwcQw8mR+MTxYGD4qUCQA5jnifmJaYgCUAHSomNimRKQOfiTAMMAYXAkAjFl+KmphjjGSwFAqAMqq2D7jMXD6i+UxSSCp6TBry8uqUCU0CdR6gnNq8uv+Vft3t9kbaOc8lwvhldU1OueGIPhWhZrI01C1zO1nMAeAl8DBoEMocQuj0+gpJtMYO91E8AhkoK5Csw2JxgLw7GZeODSBQllCYQpKSZAeZEf5KK4VGgQABJBnyJnU9SVGq4kbYMblDGzeZoPbLVbRfZUZJpELy5VwOHAfRhaiCER2BxUTnYOS1KwAPhNXJAdWOMDsAHJBSzSE7RXA7DUrV66ZqXO45XAncQIN1JK4nbiA3A8qofE6YAQsFEWNAANalaM3GK1UW58Qx5abNAAeWTaCgaoyGuV2t1hQEwggRqQHNt4h9lmtHbN9poztdZndnshscD8RDYYjUeLmvjBRDVZkUBzsfz88eNzExd3lWytQ0QA
Additional context
No response

If you specify the type, you'll see that the event is not allowed:
          actions: sendTo(({ system }) => system.get('childMachine') as ActorRefFrom<typeof childMachine>, ({
            type: 'notify',
            data: 'error',
          })),

In general, using as ActorRefFrom<...> is a viable work-around. See here: https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgYygUwIYzQWQ8gC2ADs0AaOAZzRgFcwLKwMB3YgYSIBsATRtYjwAqECgEFkMaACU0AMwBiUCCDgBfOHOWqARAA9KMLGh0BuAFDnkEYoZTceeQiTRwAvFRr0AFAnNw4GABPMDRKAC5EfwC4NAA3ARgIxA0MSiiYmODQyJ1KFTQAUQTiGB0yaMyeLAxIwygSAHNK9Wi1czUASgA6VExsJyJSX2iSYBhgDC5cgEZy6MNjZL9MuWAoQwBlI2xIlcy4Gz2WzPyQIpKYY4ODoyhGmlzqa0Ft4x0TmPab76+K07QLx4b12KTaHU6lhedhA+CGrg8fWMgxcIwCwB4uXwUig83RxHGk2mcB0aw2MBBJn+sVKUCCdWYbE4wF43mcvBRpAo+3RmJJ7MccJceJilCChjQIAAknydALOSY2p1qYtsMsWmStjs0NcDkcMjcqAVioldYa4NjgDZktRBCJvL4qOLsKouu4AHxOiUgboPGDeADk8qFpADyrg3k6HojPPNgRCOrgAeIEAmciCAepcbg1SMkQDMAIWHSLGgAGsmpnPpkusrq+oswczmgAPKFtBQE2lM2Gy3WuoCYQQB1IMXe9RRtyescu300QPB5yhqNpOASHGyRTaAA82TQEDk9hZgqXaHdFDR2fjOSTKbTGcb5tztSTHeUUCr2drj7+nzUjf-NoKi6UwgA

Thanks, type assertion like as ActorRefFrom<typeof childMachine> works like a charm! No I do not need to import events from childMachine to create the correct event. So it boils down to correct types within system.get() (if that is possible), then all errors would be resolved.
(I edited the reproduction to better explain the errors)

Ok, type assertion gets problematic when you want to send events back and forth between parent and child, because of circular type reference

I'm having the same problem while following the doc example for the send parent action :
import { createMachine, sendTo } from 'xstate';

const childMachine = createMachine({
  context: ({ input }) => ({
    parentRef: input.parentRef
  }),
  on: {
    someEvent: {
      actions: sendTo(
        ({ context }) => context.parentRef,
        { type: 'tellParentSomething' }
      ),
    }
  }
});

const parentMachine = createMachine({
  // ...
  invoke: {
    id: 'child',
    src: childMachine,
    input: ({ self }) => ({
      parentRef: self
    })
  },
  on: {
    tellParentSomething: {
      actions: () => {
        console.log('Child actor told parent something');
      }
    }
  }
});

const parentActor = createActor(parentMachine);

parentActor.start();

Trying to type the parent in the child like this :
{
	types: {
		context: {} as {
			parent: ActorRefFrom<typeof parentMachine>
		}
	}
}

Result in errors in both parent and child:
`childMachine` implicitly has type  because it does not have a type annotation and is referenced directly or indirectly in its own initializer.

`parentMachine` implicitly has type  because it does not have a type annotation and is referenced directly or indirectly in its own initializer.

Note that my parent context also keeps all of his children in his context.
A temporary solution is to use AnyActorRef, but that's not ideal.
I understand why the situation is happening because it is a circular reference (parent must know the children type, and child must know the parent type), but I'm not sure what is the workaround to achieve type-safety in this scenario.

cc. @Andarist


Nill pointer exceptions

hi Robfig,
I am thankful to you for providing such amazing corn support in Golang. I have been using this for a while now, it is very cleanly, nicely and abstractly written, making our tasks quite easier to deliver.
But of late I started to face this panic
socketmaster[21064] 2020/04/13 12:00:00 [1978] 2020/04/13 12:00:00 cron.go:229: cron: panic running job: runtime error: invalid memory addres
s or nil pointer dereference
socketmaster[21064] 2020/04/13 12:00:00 [1978] goroutine 436 [running]:
socketmaster[21064] 2020/04/13 12:00:00 [1978] github.com/XXX/XXX/vendor/github.com/robfig/cron.(*Cron).runWithRecovery.func1(0xc42
028ee60)
socketmaster[21064] 2020/04/13 12:00:00 [1978]  /share/dpkg-build/XXX-build/src/github.com/XXX/XXX/vendor/github.com/robfig/cro
n/cron.go:161 +0xbc
socketmaster[21064] 2020/04/13 12:00:00 [1978] panic(0x8b10c0, 0xc3ec90)
socketmaster[21064] 2020/04/13 12:00:00 [1978]  /home/buildbot/.gvm/gos/go1.10/src/runtime/panic.go:505 +0x229
socketmaster[21064] 2020/04/13 12:00:00 [1978] github.com/XXX/XXX/vendor/github.com/robfig/cron.FuncJob.Run(0x0)
socketmaster[21064] 2020/04/13 12:00:00 [1978]  /share/dpkg-build/XXX-build/src/github.com/XXX/XXX/vendor/github.com/robfig/cro
n/cron.go:92 +0x20
socketmaster[21064] 2020/04/13 12:00:00 [1978] github.com/XXX/XX/vendor/github.com/robfig/cron.(*Cron).runWithRecovery(0xc42028ee6
0, 0xa14320, 0x0)
socketmaster[21064] 2020/04/13 12:00:00 [1978]  /share/dpkg-build/XX-build/src/github.com/XXX/XXX/vendor/github.com/robfig/cro
n/cron.go:165 +0x57
socketmaster[21064] 2020/04/13 12:00:00 [1978] created by github.com/XXX/XXXX/vendor/github.com/robfig/cron.(*Cron).run
socketmaster[21064] 2020/04/13 12:00:00 [1978]  /share/dpkg-build/xxx-build/src/github.com/XXX/XXX/vendor/github.com/robfig/cro
n/cron.go:199 +0x744
I tried to deep dive into this. But didn't got any proper solution to this problem. So I request to help me.

Thank you for the kind words.
The stack trace reports that it was trying to run a nil job. Is it possible that one of the jobs added was not initialized?

@robfig No, it is not possible
The job we add is always initialized

I'm sorry, I don't know what else it could be. I would need a reproducer to investigate. Please do reopen if that's possible, but since it's been a long time, I assume this is no longer a problem.


Improve script mediator docs

We should improve our documentation around the available APIs in the script mediator with proper examples.
Related issue for EI650 [2]
Related mail thread: "WSO2 Enterprise Integrator: Script mediator"
[1] https://github.com/wso2/docs-ei/blob/master/en/micro-integrator/docs/references/mediators/script-Mediator.md
[2] https://github.com/wso2/product-ei/issues/4380

We have introduced GraalVM as the default JS engine for the js language. The MI doc is changed according to that. https://mi.docs.wso2.com/en/latest/reference/mediators/script-mediator/#examples
Hence this improvement is invalid now.


bug:  dataP->id always 0 when write resource id

object_write in object.c
After lwm2m_data_parse , dataP->id seems not assign any value.  So dataP->id is always 0.
Should assign "dataP->id = uriP->resourceId;"
coap_status_t object_write(lwm2m_context_t * contextP,
                           lwm2m_uri_t * uriP,
                           lwm2m_media_type_t format,
                           uint8_t * buffer,
                           size_t length)
{
    coap_status_t result = NO_ERROR;
    lwm2m_object_t * targetP;
    lwm2m_data_t * dataP = NULL;
    int size = 0;

    targetP = prv_findObject(contextP, uriP->objectId);
    if (NULL == targetP)
    {
        result = COAP_404_NOT_FOUND;
    }
    else if (NULL == targetP->writeFunc)
    {
        result = COAP_405_METHOD_NOT_ALLOWED;
    }
    else
    {
        size = lwm2m_data_parse(uriP, buffer, length, format, &dataP)

    dataP->id = uriP->resourceId;  // assign here

        if (size == 0)
        {
            result = COAP_406_NOT_ACCEPTABLE;
        }
    }
    if (result == NO_ERROR)
    {
        result = targetP->writeFunc(uriP->instanceId, size, dataP, targetP);
        lwm2m_data_free(size, dataP);
    }
    return result;
}

Thanks for spotting this.
I made another fix: #138. The issue lies deeper in the parsing function.
Regards

Fixed by #138


Document how to run python on Windows for README.md

Currently the documentation is only for Linux
https://docs.python.org/3.4/tutorial/venv.html

Not needed


Weather closings

An option for weather closings?  I dont know the best way to request it or best practices

in my area we mark the meetings as unpublished for weather closings, this way it wont show up in bmlt. then when weathers nice mark as published again.

Update the title to indicate so?  Seems like something that would apply at the BMLT data level.

It's likely that this feature would never be implemented.