This commit is contained in:
marcus 2022-02-17 15:50:39 +01:00
parent 936b72bb6f
commit 3f95300da3
8 changed files with 298 additions and 368 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
</project> </project>

View File

@ -2,7 +2,7 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Eventboard_2.0.iml" filepath="$PROJECT_DIR$/.idea/Eventboard_2.0.iml" /> <module fileurl="file://$PROJECT_DIR$/.idea/Eventboard_v_2.0.iml" filepath="$PROJECT_DIR$/.idea/Eventboard_v_2.0.iml" />
</modules> </modules>
</component> </component>
</project> </project>

View File

@ -24,8 +24,8 @@ const char* password = "your password";
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 8, "day": "08",
"month": 2, "month": "02",
"year": 1989 "year": 1989
}, },
"name": "Ines {{years}}. Geburtstag", "name": "Ines {{years}}. Geburtstag",

View File

@ -1,6 +1,9 @@
host = 'Device Ip' # ur device ip, where u upload the matrix.ino host = '192.168.0.19' # ur device ip, where u upload the matrix.ino
garbage = 'true' # set true if u have a formated Json file
#Edit the Events, decide what u wanna show on you Led Matrix
garbage = 'true'
events = 'true'
holidays = 'false'
get_request = '/set?text=' # dont touch this line get_request = '/set?text=' # dont touch this line

View File

@ -26,22 +26,42 @@ def read_JSON(filename):
f.close() f.close()
return data return data
# Returns the Garbage # Returns the Garbage
def create_Message(): def create_Message():
message = ''
if config.garbage == 'true': if config.garbage == 'true':
for i in read_JSON('muell.json'): for i in read_JSON('muell.json'):
day = i['date']['day'] day = i['date']['day']
month = i['date']['month'] month = i['date']['month']
year = i['date']['year'] if day == get_current_date()[0] and month == get_current_date()[1]:
message = message + ' ' + i['name']
if config.events == 'true':
filename = 'events.json'
for i in read_JSON(filename):
day = i['date']['day']
month = i['date']['month']
if day == get_current_date()[0] and month == get_current_date()[1]:
message = message + ' ' + i['message']
if config.holidays == 'true':
filename = 'holidays.json'
for i in read_JSON(filename):
day = i['date']['day']
month = i['date']['month']
if day == get_current_date()[0] and month == get_current_date()[1]:
message = message + ' ' + i['message']
if day == get_current_date()[0] and \
month == get_current_date()[1] and \
year == get_current_date()[2]:
return i['name']
# Send Message to the Device # Send Message to the Device
def matrixRequest(): def matrixRequest():
requests.get('http://' + config.host + config.get_request + create_Message()) requests.get('http://' + config.host + config.get_request + str(create_Message()))
matrixRequest() matrixRequest()

View File

@ -1,10 +1,9 @@
{ [
"events": [ {
{
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 21, "day": "21",
"month": 11, "month": "11",
"year": 2021 "year": 2021
}, },
"name": "Lottas {{years}}. Geburtstag", "name": "Lottas {{years}}. Geburtstag",
@ -13,8 +12,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 8, "day": "08",
"month": 2, "month": "02",
"year": 1989 "year": 1989
}, },
"name": "Ines {{years}}. Geburtstag", "name": "Ines {{years}}. Geburtstag",
@ -23,18 +22,18 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 2, "day": "02",
"month": 5, "month": "05",
"year": 1961 "year": 1961
}, },
"name": "Rudis {{years}}. Geburtstag", "name": "Rudis {{years}}. Geburtstag",
"message": "Nur noch {{hours}} Stunden bis {{name}}!" "message": "Nur noch {{hours}} Stunden bis {{name}}!"
}, },
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 1, "day": "01",
"month": 2, "month": "02",
"year": 1936 "year": 1936
}, },
"name": "Oma Ferls {{years}}. Geburtstag", "name": "Oma Ferls {{years}}. Geburtstag",
@ -43,8 +42,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 24, "day": "24",
"month": 5, "month": "05",
"year": 1967 "year": 1967
}, },
"name": "Haikes {{years}}. Geburtstag", "name": "Haikes {{years}}. Geburtstag",
@ -53,8 +52,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 19, "day": "19",
"month": 2, "month": "02",
"year": 1966 "year": 1966
}, },
"name": "Marios {{years}}. Geburtstag", "name": "Marios {{years}}. Geburtstag",
@ -63,8 +62,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 24, "day": "24",
"month": 12, "month": "12",
"year": 2021 "year": 2021
}, },
"name": "{{years}}. Verlobungstag", "name": "{{years}}. Verlobungstag",
@ -73,8 +72,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 21, "day": "21",
"month": 2, "month": "02",
"year": 1985 "year": 1985
}, },
"name": "Susannes {{years}}. Geburtstag", "name": "Susannes {{years}}. Geburtstag",
@ -83,8 +82,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 26, "day": "26",
"month": 3, "month": "03",
"year": 1971 "year": 1971
}, },
"name": "Christians Geburtstag", "name": "Christians Geburtstag",
@ -93,8 +92,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 21, "day": "21",
"month": 4, "month": "04",
"year": 1999 "year": 1999
}, },
"name": "Steffens {{years}}. Geburtstag", "name": "Steffens {{years}}. Geburtstag",
@ -103,8 +102,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 17, "day": "17",
"month": 1, "month": "01",
"year": 1986 "year": 1986
}, },
"name": "Marcus Geburtstag", "name": "Marcus Geburtstag",
@ -113,8 +112,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 18, "day": "18",
"month": 9, "month": "09",
"year": 1943 "year": 1943
}, },
"name": "Erikas Geburtstag", "name": "Erikas Geburtstag",
@ -123,8 +122,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 20, "day": "20",
"month": 9, "month": "09",
"year": 1967 "year": 1967
}, },
"name": "Michaelas Geburtstag", "name": "Michaelas Geburtstag",
@ -133,8 +132,8 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 26, "day": "26",
"month": 9, "month": "09",
"year": 1966 "year": 1966
}, },
"name": "Markus Geburtstag", "name": "Markus Geburtstag",
@ -143,12 +142,11 @@
{ {
"type": "fixed", "type": "fixed",
"date": { "date": {
"day": 8, "day": "08",
"month": 11, "month": "11",
"year": 1995 "year": 1995
}, },
"name": "Viviennes {{years}}. Geburtstag", "name": "Viviennes {{years}}. Geburtstag",
"message": "Nur noch {{hours}} Stunden bis {{name}}!" "message": "Nur noch {{hours}} Stunden bis {{name}}!"
} }
] ]
}

View File

@ -1,202 +1,102 @@
{ [
"holidays": [
{ {
"type": "fixed", "type": "fixed",
"date": { "day": 1, "month": 1, "year": 0 }, "date": {
"day": "01",
"month": "01",
"year": 0
},
"name": "Neujahr", "name": "Neujahr",
"message": "Nur noch {{hours}} Stunden bis {{name}}!" "message": "Nur noch {{hours}} Stunden bis {{name}}!"
}, },
{ {
"type": "fixed", "type": "fixed",
"date": { "day": 1, "month": 5, "year": 1946 }, "date": {
"day": "01",
"month": "05",
"year": 1946
},
"name": "Tag der Arbeit", "name": "Tag der Arbeit",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
}, },
{ {
"type": "fixed", "type": "fixed",
"date": { "day": 3, "month": 10, "year": 1990 }, "date": {
"day": "03",
"month": "10",
"year": 1990
},
"name": "Tag der deutschen Einheit", "name": "Tag der deutschen Einheit",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
}, },
{ {
"type": "fixed", "type": "fixed",
"date": { "day": 31, "month": 10, "year": 1850 }, "date": {
"day": "31",
"month": "10",
"year": 1850
},
"name": "Halloween{1}", "name": "Halloween{1}",
"message": "Nur noch {{hours}} Stunden bis {{name}}!" "message": "Nur noch {{hours}} Stunden bis {{name}}!"
}, },
{ {
"type": "fixed", "type": "fixed",
"date": { "day": 1, "month": 11, "year": 1833 }, "date": {
"day": "01",
"month": "11",
"year": 1833
},
"name": "Allerheiligen", "name": "Allerheiligen",
"message": "Nur noch {{hours}} Stunden bis {{name}}!" "message": "Nur noch {{hours}} Stunden bis {{name}}!"
}, },
{ {
"type": "fixed", "type": "fixed",
"date": { "day": 11, "month": 11, "year": 1833 }, "date": {
"day": "11",
"month": "11",
"year": 1833
},
"name": "Fastnacht", "name": "Fastnacht",
"message": "Nur noch {{hours}} Stunden bis die {{name}} beginnt!" "message": "Nur noch {{hours}} Stunden bis die {{name}} beginnt!"
}, },
{ {
"type": "fixed", "type": "fixed",
"date": { "day": 24, "month": 12, "year": 0 }, "date": {
"day": "24",
"month": "12",
"year": 0
},
"name": "Heilig Abend", "name": "Heilig Abend",
"message": "Nur noch {{hours}} Stunden bis {{name}}!" "message": "Nur noch {{hours}} Stunden bis {{name}}!"
}, },
{ {
"type": "fixed", "type": "fixed",
"date": { "day": 25, "month": 12, "year": 0 }, "date": {
"day": "25",
"month": "12",
"year": 0
},
"name": "1. Weihhnachtstag", "name": "1. Weihhnachtstag",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
}, },
{ {
"type": "fixed", "type": "fixed",
"date": { "day": 26, "month": 12, "year": 0 }, "date": {
"day": "26",
"month": "12",
"year": 0
},
"name": "2. Weihhnachtstag", "name": "2. Weihhnachtstag",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
}, },
{ {
"type": "fixed", "type": "fixed",
"date": { "day": 31, "month": 12, "year": 0 }, "date": {
"day": "31",
"month": "12",
"year": 0
},
"name": "Silvester", "name": "Silvester",
"message": "Nur noch {{hours}} Stunden bis {{name}}!" "message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "advent",
"days": 0,
"name": "1. Advent",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
},
{
"type": "dynamic",
"base": "advent",
"days": 7,
"name": "2. Advent",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
},
{
"type": "dynamic",
"base": "advent",
"days": 14,
"name": "3. Advent",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
},
{
"type": "dynamic",
"base": "advent",
"days": 21,
"name": "4. Advent",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
},
{
"type": "dynamic",
"base": "advent",
"days": -14,
"name": "Volkstrauertag",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
},
{
"type": "dynamic",
"base": "advent",
"days": -11,
"name": "Buß- und Bettag",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
},
{
"type": "dynamic",
"base": "advent",
"days": -7,
"name": "Totensonntag",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": -52,
"name": "Weiberfastnacht",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": -48,
"name": "Rosenmontag",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": -47,
"name": "Fastnachtsdienstag",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": -46,
"name": "Aschermittwoch",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": -3,
"name": "Gründonnerstag",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": -2,
"name": "Karfreitag",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": 0,
"name": "Ostersonntag",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": 1,
"name": "Ostermontag",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": 39,
"name": "Christi Himmelfahrt",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": 49,
"name": "Pfingstsonntag",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": 50,
"name": "Pfingstmontag",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
},
{
"type": "dynamic",
"base": "easter",
"days": 60,
"name": "Fronleichnam",
"message": "Nur noch {{hours}} Stunden bis {{name}}!"
} }
] ]
}

View File

@ -16,6 +16,15 @@
"year": "2022" "year": "2022"
}, },
"name": "Biomuell" "name": "Biomuell"
},
{
"tag": "Di",
"date": {
"day": "17",
"month": "02",
"year": "2022"
},
"name": "TESTMESSAGE MÜLL"
}, },
{ {
"tag": "Do", "tag": "Do",