Compare commits

..

1 commit

Author SHA1 Message Date
FC Stegerman
fd06fed1f2
fix type for notificationIDList in _build_monitor_data() 2023-09-16 23:09:40 +02:00
6 changed files with 4 additions and 23 deletions

View file

@ -1,10 +1,5 @@
## Changelog
### Release 1.2.1
#### Bugfixes
- drop first info event without a version
### Release 1.2.0
#### Features

View file

@ -12,7 +12,7 @@ Supported Uptime Kuma versions:
| Uptime Kuma | uptime-kuma-api |
|-----------------|-----------------|
| 1.21.3 - 1.23.2 | 1.0.0 - 1.2.1 |
| 1.21.3 - 1.23.1 | 1.0.0 - 1.2.0 |
| 1.17.0 - 1.21.2 | 0.1.0 - 0.13.0 |
Installation

View file

@ -5,7 +5,7 @@ if [ $version ]
then
versions=("$version")
else
versions=(1.23.2 1.23.0 1.22.1 1.22.0 1.21.3)
versions=(1.23.1 1.23.0 1.22.1 1.22.0 1.21.3)
fi
for version in ${versions[*]}

View file

@ -1,6 +1,5 @@
import unittest
from uptime_kuma_api import UptimeKumaApi
from uptime_kuma_test_case import UptimeKumaTestCase
@ -10,16 +9,6 @@ class TestInfo(UptimeKumaTestCase):
self.assertIn("version", info)
self.assertIn("latestVersion", info)
def test_info_with_version(self):
# If wait_events is set to 0, the first info event is normally used.
# The info event handler needs to drop this first event without a version.
self.api.logout()
self.api.disconnect()
self.api = UptimeKumaApi(self.url, wait_events=0)
self.api.login(self.username, self.password)
info = self.api.info()
self.assertIn("version", info)
if __name__ == '__main__':
unittest.main()

View file

@ -1,5 +1,5 @@
__title__ = "uptime_kuma_api"
__version__ = "1.2.1"
__version__ = "1.2.0"
__author__ = "Lucas Held"
__license__ = "MIT"
__copyright__ = "Copyright 2023 Lucas Held"

View file

@ -626,9 +626,6 @@ class UptimeKumaApi(object):
self._event_data[Event.IMPORTANT_HEARTBEAT_LIST][monitor_id] = [data] + self._event_data[Event.IMPORTANT_HEARTBEAT_LIST][monitor_id]
def _event_info(self, data) -> None:
if "version" not in data:
# wait for the info event that is sent after login and contains the version
return
self._event_data[Event.INFO] = data
def _event_cert_info(self, monitor_id, data) -> None:
@ -795,7 +792,7 @@ class UptimeKumaApi(object):
accepted_statuscodes = ["200-299"]
if notificationIDList is None:
notificationIDList = {}
notificationIDList = []
data = {
"type": type,