Skip to content

Commit

Permalink
docs: clean up README, LICENCE, CHANGELOG
Browse files Browse the repository at this point in the history
Closes #79
  • Loading branch information
berka3 committed Apr 23, 2024
1 parent 60816c6 commit a355e29
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 97 deletions.
82 changes: 0 additions & 82 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2000-2021 JetBrains s.r.o.
Copyright 2024 Open200 GmbH.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

The **Xesar-Connect** library is an open-source Kotlin wrapper designed to simplify MQTT communication for seamless integration of the EVVA Xesar access control system with other software applications. This library streamlines the process of exchanging data and commands between your software and the EVVA Xesar system using the MQTT protocol.

## ⚠️ Beta Notice ⚠️

Please note that Xesar-Connect is currently in beta. This means that while the library is fully functional and usable, there is a possibility of encountering issues or facing breaking changes in future releases. We appreciate your feedback and encourage you to report any problems you encounter.


## Features

- **Simplified Integration:** Xesar-Connect offers an intuitive interface that abstracts the complexities of MQTT communication, enabling developers to focus on seamlessly integrating Xesar functionality into their Kotlin applications.
Expand All @@ -29,7 +24,7 @@ Xesar-Connect is tested with EVVA's Xesar version 3.1 with Mqtt API version 1.2.

```kotlin
dependencies {
implementation("com.open200:xesar-connect:0.9.0")
implementation("com.open200:xesar-connect:1.0.0")
}
```

Expand All @@ -51,7 +46,7 @@ fun main() {
// connect to the MQTT broker and login to xesar
val xesar = XesarConnect.connectAndLoginAsync(Config.configureFromZip(pathToZip)).await()

// Subscribe to topics all topics (or the topics you are interested in)
// Subscribe to topics ALL_TOPICS (or the topics you are interested in)
xesar.subscribeAsync(Topics(Topics.ALL_TOPICS)).await()

// send command to create a person
Expand All @@ -65,16 +60,22 @@ fun main() {
).await()

// query all persons
xesar.queryPersonListAsync().await().let {
log.info { "Received person list: $it" }
}
val persons = xesar.queryPersons()
log.info { "Received person list: ${persons.data}" }

// query one person by id
val person = xesar.queryPersonByIdAsync(personId).await()

// send command to delete a person
xesar.deletePersonAsync(person.externalId).await()
val person = xesar.queryPersonById(personId)
person?.let {
// send command to delete this person
xesar.deletePersonAsync(person.externalId).await()
}

// fetching persons incrementally in smaller,more manageable chunks
val chunkSize = 15
xesar.queryStreamPerson(Query.Params(pageLimit =chunkSize)).collect{
log.info { "person: ${it.firstName}, ${it.lastName}" }
}

// subscribe to the access event and listen to battery warnings. You can use the provided enums for the events from the library
val batteryEmptyTopic = Topics.Event.accessProtocolEventTopic(GroupOfEvent.EvvaComponent, EventType.BATTERY_EMPTY)
xesar.on(TopicFilter(batteryEmptyTopic)) {
Expand Down

0 comments on commit a355e29

Please sign in to comment.