Skip to content

Commit

Permalink
Add error for wrong homekit source #805
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Dec 30, 2023
1 parent 89e15d9 commit 458d5e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/hap/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ func (c *Client) DeviceHost() string {
}

func (c *Client) Dial() (err error) {
if len(c.ClientID) == 0 || len(c.ClientPrivate) == 0 {
return errors.New("hap: can't dial witout client_id or client_private")
}

// update device address (host and/or port) before dial
_ = mdns.QueryOrDiscovery(c.DeviceHost(), mdns.ServiceHAP, func(entry *mdns.ServiceEntry) bool {
if entry.Complete() && entry.Info["id"] == c.DeviceID {
Expand Down

0 comments on commit 458d5e7

Please sign in to comment.