Skip to content

Commit

Permalink
Commit to add reminders object
Browse files Browse the repository at this point in the history
Signed-off-by: fowlerk <keith.fowler.kf@gmail.com>
  • Loading branch information
fowlerk committed Dec 5, 2020
1 parent fc15a50 commit 6cfd6f1
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyecobee/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
from pyecobee.objects.output import Output
from pyecobee.objects.page import Page
from pyecobee.objects.program import Program
from pyecobee.objects.reminder import Reminder
from pyecobee.objects.remote_sensor import RemoteSensor
from pyecobee.objects.remote_sensor_capability import RemoteSensorCapability
from pyecobee.objects.report_job import ReportJob
Expand Down
111 changes: 111 additions & 0 deletions pyecobee/objects/reminder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
"""
This module is home to the Reminder class
"""
from pyecobee.ecobee_object import EcobeeObject


# class ThermostatReminder2(EcobeeObject):
class Reminder(EcobeeObject):

"""
Attribute names have been generated by converting ecobee property names from camelCase to snake_case.
A getter property has been generated for each attribute.
A setter property has been generated for each attribute whose value of READONLY is "no".
An __init__ argument without a default value has been generated if the value of REQUIRED is "yes".
An __init__ argument with a default value of None has been generated if the value of REQUIRED is "no".
"""

__slots__ = [
"_type",
"_title",
"_description",
"_reminder_date",
"_remind_me",
]

attribute_name_map = {
"type": "type",
"title": "title",
"description": "description",
"reminder_date": "reminderDate",
"reminderDate": "reminder_date",
"remind_me": "remindMe",
"remindMe": "remind_me",
}

attribute_type_map = {
"type": "six.text_type",
"title": "six.text_type",
"description": "six.text_type",
"reminder_date": "six.text_type",
"remind_me": "bool",
}

def __init__(
self, type_, title=None, description=None, reminder_date=None, remind_me=None
):
"""
Construct a Reminder instance
"""
self._type = type_
self._title = title
self._description = description
self._reminder_date = reminder_date
self._remind_me = remind_me

@property
def type(self):
"""
Gets the type attribute of this Reminder instance.
:return: The value of the type attribute of this Reminder instance.
:rtype: six.text_type
"""

return self._type

@property
def title(self):
"""
Gets the title attribute of this Reminder instance.
:return: The value of the title attribute of this Reminder instance.
:rtype: six.text_type
"""

return self._title

@property
def description(self):
"""
Gets the description attribute of this Reminder instance.
:return: The value of the description attribute of this Reminder instance.
:rtype: six.text_type
"""

return self._description

@property
def reminder_date(self):
"""
Gets the reminder_date attribute of this Reminder instance.
:return: The value of the reminder_date attribute of this Reminder instance.
:rtype: six.text_type
"""

return self._reminder_date

@property
def remind_me(self):
"""
Gets the remind_me attribute of this Reminder instance.
:return: The value of the remind_me attribute of this Reminder instance.
:rtype: bool
"""

return self._remind_me
4 changes: 2 additions & 2 deletions pyecobee/objects/thermostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Thermostat(EcobeeObject):
'utc_time': 'six.text_type',
'audio': 'Audio',
'alerts': 'List[Alert]',
'reminders': 'List[ThermostatReminder2]',
'reminders': 'List[Reminder]',
'settings': 'Settings',
'runtime': 'Runtime',
'extended_runtime': 'ExtendedRuntime',
Expand Down Expand Up @@ -402,7 +402,7 @@ def reminders(self):
:return: The value of the reminders attribute of this Thermostat
instance.
:rtype: List[ThermostatReminder2]
:rtype: List[Reminder]
"""

return self._reminders
Expand Down
1 change: 1 addition & 0 deletions pyecobee/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from pyecobee.objects.output import Output
from pyecobee.objects.page import Page
from pyecobee.objects.program import Program
from pyecobee.objects.reminder import Reminder
from pyecobee.objects.remote_sensor import RemoteSensor
from pyecobee.objects.remote_sensor_capability import RemoteSensorCapability
from pyecobee.objects.report_job import ReportJob
Expand Down

0 comments on commit 6cfd6f1

Please sign in to comment.