edgeberry 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
edgeberry/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .edgeberry import Edgeberry
|
edgeberry/edgeberry.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""
|
|
2
|
+
edgeberry.py
|
|
3
|
+
Core functionality for Edgeberry device.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
from pydbus import SystemBus # D-Bus System bus
|
|
8
|
+
|
|
9
|
+
# Edgeberry Core D-Bus
|
|
10
|
+
EDGEBERRY_SERVICE = "io.edgeberry.Core"
|
|
11
|
+
EDGEBERRY_OBJECT = "io/edgeberry/Core"
|
|
12
|
+
EDGEBERRY_INTERFACE = "io.edgeberry.Core"
|
|
13
|
+
|
|
14
|
+
class Edgeberry:
|
|
15
|
+
def __init__(self):
|
|
16
|
+
try:
|
|
17
|
+
# Connect to the D-Bus system bus
|
|
18
|
+
self.bus = SystemBus()
|
|
19
|
+
# Connect to the Edgeberry Core service
|
|
20
|
+
self.edgeberry_core_service = self.bus.get(EDGEBERRY_SERVICE)
|
|
21
|
+
except Exception as e:
|
|
22
|
+
print(f"Edgeberry: error connecting to Edgeberry D-Bus: {e}")
|
|
23
|
+
return None
|
|
24
|
+
|
|
25
|
+
# Set application info
|
|
26
|
+
def set_application_info(self, name, version, description):
|
|
27
|
+
try:
|
|
28
|
+
# Create dictionary
|
|
29
|
+
application_info = {
|
|
30
|
+
"name": name,
|
|
31
|
+
"version": version,
|
|
32
|
+
"description": description
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
# Convert dictionary to JSON string
|
|
36
|
+
application_info_json = json.dumps(application_info)
|
|
37
|
+
|
|
38
|
+
# Call the 'SetApplicationStatus' method on the Edgeberry Core service object
|
|
39
|
+
return self.edgeberry_core_service.SetApplicationStatus(application_info_json)
|
|
40
|
+
|
|
41
|
+
except Exception as e:
|
|
42
|
+
# Print the error message
|
|
43
|
+
print(f"Edgeberry: error setting status: {e}")
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
def set_status(self, level, message):
|
|
47
|
+
try:
|
|
48
|
+
# Create dictionary
|
|
49
|
+
status = {
|
|
50
|
+
"level": level,
|
|
51
|
+
"message": message
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
# Convert dictionary to JSON string
|
|
55
|
+
status_json = json.dumps(status)
|
|
56
|
+
|
|
57
|
+
# Call the 'SetApplicationStatus' method on the Edgeberry Core service object
|
|
58
|
+
return self.edgeberry_core_service.SetApplicationStatus(status_json)
|
|
59
|
+
except Exception as e:
|
|
60
|
+
# Print the error message
|
|
61
|
+
print(f"Edgeberry: error setting status: {e}")
|
|
62
|
+
return None
|
|
63
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: edgeberry
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Python SDK for interfacing applications with Edgeberry
|
|
5
|
+
Home-page: https://github.com/Edgeberry/Edgeberry-Python-SDK
|
|
6
|
+
Author: Sanne 'SpuQ' Santens
|
|
7
|
+
Author-email: sanne.santens@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: pydbus
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
The **Edgeberry Python SDK** lorem ipsum ...
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
```python
|
|
21
|
+
from edgeberry import Edgeberry
|
|
22
|
+
edgeberry = Edgeberry()
|
|
23
|
+
```
|
|
24
|
+
Methods
|
|
25
|
+
```python
|
|
26
|
+
edgeberry.set_status("level", "message")
|
|
27
|
+
edgeberry.set_application_info("name", "version", "description")
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## License & Collaboration
|
|
32
|
+
**Copyright© 2024 Sanne 'SpuQ' Santens**. The Edgeberry Device Software is licensed under the **MIT License**. The [Rules & Guidelines](https://github.com/Edgeberry/.github/blob/main/brand/Edgeberry_Trademark_Rules_and_Guidelines.md) apply to the usage of the Edgeberry™ brand.
|
|
33
|
+
|
|
34
|
+
### Collaboration
|
|
35
|
+
|
|
36
|
+
If you'd like to contribute to this project, please follow these guidelines:
|
|
37
|
+
1. Fork the repository and create your branch from `main`.
|
|
38
|
+
2. Make your changes and ensure they adhere to the project's coding style and conventions.
|
|
39
|
+
3. Test your changes thoroughly.
|
|
40
|
+
4. Ensure your commits are descriptive and well-documented.
|
|
41
|
+
5. Open a pull request, describing the changes you've made and the problem or feature they address.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
edgeberry/__init__.py,sha256=q3WMH3OZRjDfe2NGfn8Snp6tpq_Bf3f9utY0pZAfQbs,32
|
|
2
|
+
edgeberry/edgeberry.py,sha256=n9XKbw4_mhfIiJqPciWIQGb8F4tbrdsFDdE3OOrV9YM,2035
|
|
3
|
+
edgeberry-0.0.1.dist-info/METADATA,sha256=qGY8OBIL3_Y54bSU5zzkrzy4zbl3wLibdph9329PGLk,1602
|
|
4
|
+
edgeberry-0.0.1.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
5
|
+
edgeberry-0.0.1.dist-info/top_level.txt,sha256=eDXCpLlBOsQpCOPS1zpazlkR3VaswNdxDDzpt43VWzk,10
|
|
6
|
+
edgeberry-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
edgeberry
|