Skip to content

Commit

Permalink
Released v1.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dennissiemensma committed May 25, 2018
1 parent 7e80bdf commit cd97d21
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 21 deletions.
11 changes: 11 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ Please make sure you have a fresh **database backup** before upgrading! Upgradin




v1.17.0 - 2018-05-25
^^^^^^^^^^^^^^^^^^^^

**Tickets resolved in this release:**

- [`#475 <https://github.com/dennissiemensma/dsmr-reader/issues/475>`_] Notify my android service ended
- [`#471 <https://github.com/dennissiemensma/dsmr-reader/issues/471>`_] Requirements update (May 2018)



v1.16.0 - 2018-04-04
^^^^^^^^^^^^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Generated by Django 2.0.5 on 2018-05-24 19:13

from django.db import migrations, models
from django.utils.translation import ugettext_lazy


def migrate_forward(apps, schema_editor):
NotificationSetting = apps.get_model('dsmr_notification', 'NotificationSetting')
_, _ = NotificationSetting.objects.get_or_create()

if not NotificationSetting.objects.filter(notification_service='nma').exists():
return

# Did we use NMA? Disable it.
NotificationSetting.objects.update(notification_service=None, api_key=None)

import dsmr_frontend.services
Notification = apps.get_model('dsmr_frontend', 'Notification')
Notification.objects.create(
message=dsmr_frontend.services.get_translated_string(text=ugettext_lazy(
"Notify My Android has terminated their service, the notification settings in DSMR-reader are disabled."
))
)


class Migration(migrations.Migration):

dependencies = [
('dsmr_notification', '0004_statusnotificationsetting'),
]

operations = [
# Backwards migration not possible, field was removed before.
migrations.RunPython(migrate_forward),

migrations.AlterField(
model_name='notificationsetting',
name='notification_service',
field=models.CharField(blank=True, choices=[(None, '--- Disabled ---'), ('prowl', 'Prowl')], default=None, help_text='Which notification service to use for sending daily usage notifications', max_length=20, null=True, verbose_name='Notification service'),
),
]
3 changes: 0 additions & 3 deletions dsmr_notification/models/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@

class NotificationSetting(SingletonModel):
NOTIFICATION_NONE = None
NOTIFICATION_NMA = 'nma'
NOTIFICATION_PROWL = 'prowl'

NOTIFICATION_CHOICES = (
(NOTIFICATION_NONE, _('--- Disabled ---')),
(NOTIFICATION_NMA, _('NotifyMyAndroid')),
(NOTIFICATION_PROWL, _('Prowl')),
)

NOTIFICATION_API_URL = {
NOTIFICATION_NONE: None,
NOTIFICATION_NMA: 'https://www.notifymyandroid.com/publicapi/notify',
NOTIFICATION_PROWL: 'https://api.prowlapp.com/publicapi/add'
}

Expand Down
10 changes: 5 additions & 5 deletions dsmr_notification/tests/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_should_notify_set(self):
""" Notifications: Test should_notify()'s output when service is set """

notification_settings = NotificationSetting.get_solo()
notification_settings.notification_service = NotificationSetting.NOTIFICATION_NMA
notification_settings.notification_service = NotificationSetting.NOTIFICATION_PROWL
notification_settings.save()

# Should fail because we haven't set an API key
Expand Down Expand Up @@ -75,7 +75,7 @@ def test_no_daystatistics(self):
DayStatistics.objects.all().delete()

notification_settings = NotificationSetting.get_solo()
notification_settings.notification_service = NotificationSetting.NOTIFICATION_NMA
notification_settings.notification_service = NotificationSetting.NOTIFICATION_PROWL
notification_settings.api_key = 'es7sh2d-DSMR-Reader-Rulez-iweu732'
notification_settings.save()

Expand All @@ -89,7 +89,7 @@ def test_notification_api_fail(self, now_mock, requests_post_mock):
requests_post_mock.return_value = mock.MagicMock(status_code=403, text='Forbidden')

notification_settings = NotificationSetting.get_solo()
notification_settings.notification_service = NotificationSetting.NOTIFICATION_NMA
notification_settings.notification_service = NotificationSetting.NOTIFICATION_PROWL
notification_settings.api_key = 'es7sh2d-DSMR-Reader-Rulez-iweu732'
notification_settings.next_notification = timezone.localtime(timezone.now())
notification_settings.save()
Expand All @@ -116,7 +116,7 @@ def test_notifications(self, now_mock, requests_post_mock):
self.assertIsNone(notification_settings.next_notification)
self.assertFalse(requests_post_mock.called)

notification_settings.notification_service = NotificationSetting.NOTIFICATION_NMA
notification_settings.notification_service = NotificationSetting.NOTIFICATION_PROWL
notification_settings.api_key = 'es7sh2d-DSMR-Reader-Rulez-iweu732'
notification_settings.next_notification = timezone.localtime(timezone.now())
notification_settings.save()
Expand Down Expand Up @@ -157,7 +157,7 @@ def test_check_status(self, now_mock, requests_post_mock):

StatusNotificationSetting.get_solo()
notification_settings = NotificationSetting.get_solo()
notification_settings.notification_service = NotificationSetting.NOTIFICATION_NMA
notification_settings.notification_service = NotificationSetting.NOTIFICATION_PROWL
notification_settings.api_key = 'test'
notification_settings.save()

Expand Down
2 changes: 1 addition & 1 deletion dsmrreader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
from django.utils.version import get_version


VERSION = (1, 16, 0, 'final', 0)
VERSION = (1, 17, 0, 'final', 0)

__version__ = get_version(VERSION)
Binary file modified dsmrreader/locales/nl/LC_MESSAGES/django.mo
Binary file not shown.
9 changes: 6 additions & 3 deletions dsmrreader/locales/nl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -1297,12 +1297,12 @@ msgstr "Systeemcontroles voor het versturen van notificaties wanneer de datalogg
msgid "Usage notification"
msgstr "Verbruiksnotificatie"

msgid "Notify My Android has terminated their service, the notification settings in DSMR-reader are disabled."
msgstr "Notify My Android heeft hun dienstverlening beëindigd. Hierdoor zijn de notificatie-instellingen in DSMR-reader aangepast."

msgid "--- Disabled ---"
msgstr "--- Uitgeschakeld ---"

msgid "NotifyMyAndroid"
msgstr "NotifyMyAndroid"

msgid "Prowl"
msgstr "Prowl"

Expand Down Expand Up @@ -1636,6 +1636,9 @@ msgstr "Nederlands"
msgid "English"
msgstr "Engels"

#~ msgid "NotifyMyAndroid"
#~ msgstr "NotifyMyAndroid"

#~ msgid "You may check the status of your readings and data in the Status page."
#~ msgstr "Je kunt de status van de metingen bekijken op de Status-pagina."

Expand Down
10 changes: 5 additions & 5 deletions dsmrreader/provisioning/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
crcmod==1.7
coreapi==2.3.3
django==2.0.4
django==2.0.5
django-colorfield==0.1.14
django-debug-toolbar==1.9.1
django-filter==1.1.0
djangorestframework==3.8.0
djangorestframework==3.8.2
django-solo==1.1.3
dropbox==8.7.1
gunicorn==19.7.1
dropbox==8.8.1
gunicorn==19.8.1
paho-mqtt==1.3.1
pyserial==3.4
python-dateutil==2.7.2
pytz==2018.3
pytz==2018.4
requests==2.18.4
urllib3==1.22
4 changes: 2 additions & 2 deletions dsmrreader/provisioning/requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sphinx==1.7.2
sphinx==1.7.4
sphinx-autobuild==0.7.1
sphinx-intl==0.9.11
sphinx-rtd-theme==0.2.4
sphinx-rtd-theme==0.3.0
2 changes: 1 addition & 1 deletion dsmrreader/provisioning/requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
polib==1.1.0
pylama==7.4.3
pytest-cov==2.5.1
pytest-django==3.1.2
pytest-django==3.2.1
pytest-xdist==1.22.2
2 changes: 1 addition & 1 deletion dsmrreader/provisioning/requirements/travis.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# For some reason Travis needs to be forced installing this version, or the build pretend like it doesn't know 'pytest'.
pytest==3.5.0
pytest==3.5.1

0 comments on commit cd97d21

Please sign in to comment.