203 lines
9.7 KiB
Django/Jinja
203 lines
9.7 KiB
Django/Jinja
{% macro greeting(date) %}
|
|
{% if now().strftime('%H')|int < 12 %}
|
|
{{ [
|
|
"Good morning. ",
|
|
"Top of the morning to you laddy. ",
|
|
] | random }}
|
|
{% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %}
|
|
{{ [
|
|
"Greetings earthling. ",
|
|
"Good afternoon. ",
|
|
"How do you do, fellow kids? ",
|
|
"Howdy partner. ",
|
|
"Greetings, human overlords. ",
|
|
] | random }}
|
|
{% else %}
|
|
{{ [
|
|
"Good evening. ",
|
|
"The grandest of evenings to you. "
|
|
] | random }}
|
|
{% endif %}
|
|
{% if is_state('binary_sensor.morning','on') and date == 'date' %}
|
|
Today's date is {{ as_timestamp(now()) | timestamp_custom('%B %d %Y') }}.
|
|
{% endif %}
|
|
It is {{ now().strftime("%I:%M %p") }}.
|
|
{% endmacro %}
|
|
|
|
{% macro today_is() %}
|
|
{{ [
|
|
'Today is ',
|
|
'If you have not been keeping track today is ',
|
|
'Do you know what day of the week it is? Today is',
|
|
'I hate to be the bearer of bad news, but today is ',
|
|
'In case you do not own a calendar, today is ',
|
|
'If you have forgotten the order in which the week progresses, today is ',
|
|
'Because we all forget sometimes, today is ',
|
|
'What day is today? Oh, right, it is '
|
|
]|random }}
|
|
{{ states('sensor.today_is') }}.
|
|
{% endmacro %}
|
|
|
|
{% macro dadjoke() %}
|
|
{{ [
|
|
"Here is a random dad joke ",
|
|
"In case you hadn't had enough idiotic humor today, here is a little more ",
|
|
"The best jokes are the dumb ones like this one ",
|
|
"And now for todays episode of humor for morons ",
|
|
"We are all dead inside, so here is another idiotic joke ",
|
|
] | random }}<break time="1s"/> {{ states('sensor.random_joke') }}
|
|
{% endmacro %}
|
|
|
|
{% macro inspirational_quote() %}
|
|
{{ [
|
|
"Life is about making an impact, make it a positive one. ",
|
|
"Whatever the mind of man can conceive and believe, it can achieve. ",
|
|
"Strive not to be a success, but rather to be of value. ",
|
|
"I attribute my overall success to never giving or taking an excuse. ",
|
|
"You miss one hundred percent of the shots you dont take. ",
|
|
"The most difficult thing is the decision to act, the rest is merely tenacity. ",
|
|
"The only difference between who you are and who you want to be, is what you do. ",
|
|
"Every strike brings me closer to the next home run. ",
|
|
"Defining thepurpose is the starting point of all achievement. ",
|
|
"Life is not about getting and having, it's about giving and being. ",
|
|
"We become what we think about. ",
|
|
"Be the change that you wish to see in the world. ",
|
|
"A wise man changes his mind but a fool never will. ",
|
|
"Change is inevitable. Growth is optional. ",
|
|
"dont worry, be happy. ",
|
|
"There are far better things ahead of us than behind us. ",
|
|
"If you want to go fast, go alone but if you want to go far, go with others. ",
|
|
"The key to success is to focus on goals not obstacles. ",
|
|
"Sometimes we are tested not to show our weaknesses, but to discover our strengths. ",
|
|
"Do something today that your future self will thank you for. ",
|
|
"Life is ten percent what happens to you and ninety percent how you react to it. ",
|
|
"The most common way people give up their power is by thinking they do not have any. ",
|
|
"The mind is everything. What you think, you will become. ",
|
|
"Always try to Live your best life. ",
|
|
"When nothing goes right, go left. ",
|
|
"The best time to plant a tree was twenty years ago. The second best time is now. ",
|
|
"An unexamined life is not worth living. ",
|
|
"Eighty percent of success is showing up. ",
|
|
"Do not stop when you are tired, stop when you are done. ",
|
|
"Luck is being prepared and ready for the opportunities when they come. ",
|
|
"Do not wait for opportunity. Create it.",
|
|
"action is the foundation of success. ",
|
|
"All progress takes place outside the comfort zone. ",
|
|
"You can make mistakes but you should never quit. ",
|
|
"Do not let the fear of losing be greater than the excitement of winning. ",
|
|
"The way to get started is to quit talking and begin doing. ",
|
|
"when you feel like quitting, remember why you started. ",
|
|
"The harder you work, the more luck people will think you have. ",
|
|
"The harder you work for something, the greater you will feel when you achieve it. ",
|
|
"Your time is limited, so do not waste it living someone elses life. ",
|
|
"Winning is not everything, but wanting to win is. ",
|
|
"I am not a product of my circumstances. I am a product of my decisions. ",
|
|
"You can never cross the ocean until you have the courage to lose sight of the shore. ",
|
|
"Either you run the day, or the day runs you. ",
|
|
"Whether you think you can or you think you cannot, you will be right. ",
|
|
"The two most important days in your life are the day you are born and the day you find out why. ",
|
|
"Never ruin a good day by thinking about a bad yesterday. ",
|
|
"Whatever you can do, or dream you can, begin it. Boldness has genius, power and magic in it. ",
|
|
"The best revenge is massive success. ",
|
|
"The universe cant put good into your hands unless you let go of the bad.",
|
|
"People often say that motivation does not last. Well, neither does bathing. That is why we recommend it daily. ",
|
|
"Life shrinks or expands in proportion to ones courage. ",
|
|
"If you hear a voice within you say you cannot paint, then by all means paint and that voice will be silenced. ",
|
|
"Do not raise your voice, instead improve your argument. ",
|
|
"There is only one way to avoid criticism: do nothing, say nothing, and be nothing. ",
|
|
"Ask and it will be given to you; search, and you will find; knock and the door will be opened for you. ",
|
|
"The only person you are destined to become is the person you decide to be. ",
|
|
"Go confidently in the direction of your dreams. Live the life you have imagined. ",
|
|
"Certain things catch your eye, but pursue only those that capture the heart. ",
|
|
"Believe you can and you are halfway there. ",
|
|
"Good things take time. ",
|
|
"If you cant beat the Fear... just do it scared! ",
|
|
"There is no place like home. ",
|
|
"Life can be tough but so are you. ",
|
|
"Everything you have ever wanted is on the other side of fear. ",
|
|
"Start where you are. Use what you have. Do what you can. ",
|
|
"Fall seven times and stand up eight. ",
|
|
"Everything has beauty, but not everyone can see. ",
|
|
"Life is like riding a bicycle. To keep your balance, you must keep moving. ",
|
|
"Life is not measured by the number of breaths we take, but by the moments that take our breath away. ",
|
|
"in any given moment, we can choose to move forward and grow or retreat.",
|
|
"Happiness is not something readymade. It comes from your own actions. ",
|
|
"If you are offered a seat on a rocket ship, do not ask what seat! Just get on. ",
|
|
"If the wind will not move you forward, take to the oars. ",
|
|
"If you can dream it, you can do it. ",
|
|
"You can not fall if you do not climb. But theres no joy in living your whole life on the ground. ",
|
|
"Too many of us are not living our dreams because we are living our fears. ",
|
|
"Live your dreams or live your fears. You can only choose one… ",
|
|
"Challenges are what make life interesting and overcoming them is what makes life meaningful. ",
|
|
"If you want to lift yourself up, lift up someone else. ",
|
|
"Be nice to others and nice things will happen to you.",
|
|
"Everyone has a plan until they get punched in the face. Be ready to pivot and adapt to the situation. ",
|
|
"You are the Artist of your OWN life. Dont hand the paint brush to anyone else. ",
|
|
"Try to be a rainbow for someone elses cloud. ",
|
|
"It is nice to be important, but more important to be nice.",
|
|
"You have within you right now, everything you need to deal with whatever the world can throw at you.",
|
|
"The only way to do great work is to love what you do. If you havent found it yet, keep looking. Dont settle.",
|
|
"Life is too short to waste time hating anyone.",
|
|
"Be yourself, everyone else is already taken.",
|
|
"Dream big, work hard, stay focused, and surround yourself with good people.",
|
|
"What we fear doing most is usually what we need to do most.",
|
|
"Be the energy you want to attract."
|
|
] | random }}
|
|
{% endmacro %}
|
|
|
|
{% macro kallenSleepMsg() %}
|
|
{% set schedMode = states('input_select.scheduled_climate_mode_kallen_bedroom') %}
|
|
{% if schedMode == 'White Noise' %}
|
|
{{ [
|
|
"No fan in Collin's room tonight. Too cold outside. Brr. Enjoy your white noise.",
|
|
"It is a little too cold for a fan tonight. I will play white noise for Collin",
|
|
"Collin will not need any help staying cool tonight. I will play white noise instead.",
|
|
"My sources are telling me that it is not fan weather tonight. White noise it is."
|
|
] | random }} Goodnight!
|
|
{% elif schedMode == 'Fan' %}
|
|
{{ [
|
|
"Collin's fan is now on. Stay cool!",
|
|
"It is rather warm outside, so I am turning on Collin's fan.",
|
|
"To prevent an ocean of sweat from drowning us all, I have enabled Collin's fan.",
|
|
"My sensors indicate that for optimal comfort, a cooling device is needed for Collin tonight.",
|
|
"I am a fan of Collin. So I have turned on a fan for Collin."
|
|
] | random }} Goodnight!
|
|
{% else %}
|
|
{{ [
|
|
"Lights are now on in Collin's bedroom.",
|
|
"Collin, your bedroom lights are now on."
|
|
] | random }} Goodnight!
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% macro sun_status() %}
|
|
{% if is_state('sun.sun','below_horizon') %}
|
|
You have
|
|
{% set seconds = as_timestamp(states.sun.sun.attributes.next_rising)-now().timestamp() %}
|
|
{% set hours = seconds / 60 %}
|
|
{% if seconds / ( 60 * 60 ) > 1 %}
|
|
{{ (seconds // ( 60 * 60 )) | int }} hours
|
|
{% else %}
|
|
{{ (seconds // 60) | int }} minutes
|
|
{% endif %}
|
|
{{ [
|
|
'until the sun rises.',
|
|
'until the sun is up',
|
|
'before the sun officially rises.'
|
|
] | random }}
|
|
{% else %}
|
|
You have
|
|
{% set seconds = as_timestamp(states.sun.sun.attributes.next_setting)-now().timestamp() %}
|
|
{% set hours = seconds / 60 %}
|
|
{% if seconds / ( 60 * 60 ) > 1 %}
|
|
{{ (seconds // ( 60 * 60 )) | int }} hours
|
|
{% else %}
|
|
{{ (seconds // 60) | int }} minutes
|
|
{% endif %}
|
|
{{ [
|
|
'until the sun sets for the day.',
|
|
'until the sun slips below the horizon.',
|
|
'before the sun officially sets. '
|
|
]|random }}
|
|
{% endif %}
|
|
{% endmacro %} |