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,154 +1,152 @@
{ [
"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", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "08",
"day": 8, "month": "02",
"month": 2, "year": 1989
"year": 1989 },
}, "name": "Ines {{years}}. Geburtstag",
"name": "Ines {{years}}. Geburtstag", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "02",
"day": 2, "month": "05",
"month": 5, "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": "01",
"day": 1, "month": "02",
"month": 2, "year": 1936
"year": 1936 },
}, "name": "Oma Ferls {{years}}. Geburtstag",
"name": "Oma Ferls {{years}}. Geburtstag", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "24",
"day": 24, "month": "05",
"month": 5, "year": 1967
"year": 1967 },
}, "name": "Haikes {{years}}. Geburtstag",
"name": "Haikes {{years}}. Geburtstag", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "19",
"day": 19, "month": "02",
"month": 2, "year": 1966
"year": 1966 },
}, "name": "Marios {{years}}. Geburtstag",
"name": "Marios {{years}}. Geburtstag", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "24",
"day": 24, "month": "12",
"month": 12, "year": 2021
"year": 2021 },
}, "name": "{{years}}. Verlobungstag",
"name": "{{years}}. Verlobungstag", "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "21",
"day": 21, "month": "02",
"month": 2, "year": 1985
"year": 1985 },
}, "name": "Susannes {{years}}. Geburtstag",
"name": "Susannes {{years}}. Geburtstag", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "26",
"day": 26, "month": "03",
"month": 3, "year": 1971
"year": 1971 },
}, "name": "Christians Geburtstag",
"name": "Christians Geburtstag", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "21",
"day": 21, "month": "04",
"month": 4, "year": 1999
"year": 1999 },
}, "name": "Steffens {{years}}. Geburtstag",
"name": "Steffens {{years}}. Geburtstag", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "17",
"day": 17, "month": "01",
"month": 1, "year": 1986
"year": 1986 },
}, "name": "Marcus Geburtstag",
"name": "Marcus Geburtstag", "message": "Nur noch {{hours}} Stunden bis zu {{name}}!"
"message": "Nur noch {{hours}} Stunden bis zu {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "18",
"day": 18, "month": "09",
"month": 9, "year": 1943
"year": 1943 },
}, "name": "Erikas Geburtstag",
"name": "Erikas Geburtstag", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "20",
"day": 20, "month": "09",
"month": 9, "year": 1967
"year": 1967 },
}, "name": "Michaelas Geburtstag",
"name": "Michaelas Geburtstag", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "26",
"day": 26, "month": "09",
"month": 9, "year": 1966
"year": 1966 },
}, "name": "Markus Geburtstag",
"name": "Markus Geburtstag", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": "08",
"day": 8, "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": {
"date": { "day": 1, "month": 1, "year": 0 }, "day": "01",
"name": "Neujahr", "month": "01",
"message": "Nur noch {{hours}} Stunden bis {{name}}!" "year": 0
}, },
{ "name": "Neujahr",
"type": "fixed", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"date": { "day": 1, "month": 5, "year": 1946 }, },
"name": "Tag der Arbeit", {
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "type": "fixed",
}, "date": {
{ "day": "01",
"type": "fixed", "month": "05",
"date": { "day": 3, "month": 10, "year": 1990 }, "year": 1946
"name": "Tag der deutschen Einheit", },
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "name": "Tag der Arbeit",
}, "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
{ },
"type": "fixed", {
"date": { "day": 31, "month": 10, "year": 1850 }, "type": "fixed",
"name": "Halloween{1}", "date": {
"message": "Nur noch {{hours}} Stunden bis {{name}}!" "day": "03",
}, "month": "10",
{ "year": 1990
"type": "fixed", },
"date": { "day": 1, "month": 11, "year": 1833 }, "name": "Tag der deutschen Einheit",
"name": "Allerheiligen", "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "fixed", "date": {
"date": { "day": 11, "month": 11, "year": 1833 }, "day": "31",
"name": "Fastnacht", "month": "10",
"message": "Nur noch {{hours}} Stunden bis die {{name}} beginnt!" "year": 1850
}, },
{ "name": "Halloween{1}",
"type": "fixed", "message": "Nur noch {{hours}} Stunden bis {{name}}!"
"date": { "day": 24, "month": 12, "year": 0 }, },
"name": "Heilig Abend", {
"message": "Nur noch {{hours}} Stunden bis {{name}}!" "type": "fixed",
}, "date": {
{ "day": "01",
"type": "fixed", "month": "11",
"date": { "day": 25, "month": 12, "year": 0 }, "year": 1833
"name": "1. Weihhnachtstag", },
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "name": "Allerheiligen",
}, "message": "Nur noch {{hours}} Stunden bis {{name}}!"
{ },
"type": "fixed", {
"date": { "day": 26, "month": 12, "year": 0 }, "type": "fixed",
"name": "2. Weihhnachtstag", "date": {
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "day": "11",
}, "month": "11",
{ "year": 1833
"type": "fixed", },
"date": { "day": 31, "month": 12, "year": 0 }, "name": "Fastnacht",
"name": "Silvester", "message": "Nur noch {{hours}} Stunden bis die {{name}} beginnt!"
"message": "Nur noch {{hours}} Stunden bis {{name}}!" },
}, {
{ "type": "fixed",
"type": "dynamic", "date": {
"base": "advent", "day": "24",
"days": 0, "month": "12",
"name": "1. Advent", "year": 0
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" },
"name": "Heilig Abend",
}, "message": "Nur noch {{hours}} Stunden bis {{name}}!"
{ },
"type": "dynamic", {
"base": "advent", "type": "fixed",
"days": 7, "date": {
"name": "2. Advent", "day": "25",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "month": "12",
"year": 0
}, },
{ "name": "1. Weihhnachtstag",
"type": "dynamic", "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
"base": "advent", },
"days": 14, {
"name": "3. Advent", "type": "fixed",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "date": {
"day": "26",
}, "month": "12",
{ "year": 0
"type": "dynamic", },
"base": "advent", "name": "2. Weihhnachtstag",
"days": 21, "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
"name": "4. Advent", },
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" {
"type": "fixed",
}, "date": {
{ "day": "31",
"type": "dynamic", "month": "12",
"base": "advent", "year": 0
"days": -14, },
"name": "Volkstrauertag", "name": "Silvester",
"message": "Nur noch {{hours}} Stunden bis zum {{name}}!" "message": "Nur noch {{hours}} Stunden bis {{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",