GithubHelp home page GithubHelp logo

laggat / ha-jokes Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 4.0 26 KB

Home Assistant Sensor providing a random joke every minute.

License: MIT License

Python 95.75% Shell 4.25%
home-assistant python sensor devcontainer hacs jokes fun

ha-jokes's Introduction

Jokes integration

This is the simplest but somewhat useful and funny integration I could think of. It even doesn't use a single entity, just one state returning a string.

Every Minute, a sensor provides a joke. Done.

Shoutout/Kudos

Thanks for providing the 'Random dad joke' API. They also offer Discord, Alexa and many more integrations :) Really great and fun project.

  • Logo used for this integration

Original by East718, SVG conversion: This vector image was created with Inkscape by Howcheng, and then manually edited by Giro720. CC BY-SA 3.0, via Wikimedia Commons.

Home Assistant is a great software to automate and connect anything around your home. Anything is possible.

The 'Home Assistant Community Store' is a great addition, providing even more community integrations in a decentralized manner.

Why

This component exists to develop, test and show my dev container.

https://github.com/LaggAt/ha-devcontainer

Progess

Component is working. Next is adding the dev container around it.

Sponsor

If the devcontainer or this integration is of some use for you, buy me a coffee:

Buy Me A Coffee

Thank you!

ha-jokes's People

Contributors

laggat avatar mvdwetering avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ha-jokes's Issues

Cannot find sensor.

Installed through HACS.
The sensor is not showing up.

image

Edit : My bad. You have to add the integration after downloading the component in HACS

Add Unique ID to be able to remove sensor from recorder

If you try to go to "Settings" of sensor.random_joke, you will see this message:

This entity ('sensor.random_joke') does not have a unique ID, therefore its settings cannot be managed from the UI. See the [documentation](https://www.home-assistant.io/faq/unique_id) for more detail.

Also, this code will not work

recorder:
  ...
  exclude:
    entities:
      - sensor.random_joke

I think that it is same issue. So DB is bloated with jokes. I don't think it is common use-case, when you need history of jokes. Most people will see random joke only just now.

Can you add Unique ID to sensor.random_joke

Add Jokes to HACS default integrations

HowTo:

  • fork hacs/defaults
  • create branch: integration-jokes
  • create pull request in hacs/default:master
  • check for successful completion of all checks in PR
  • wait for someone to review/merge

Change Poll Time

Any chance you can allow the user to determine the poll time (either from a set list or by entering time)? Currently I get a new joke every minute. No big deal, but when I want to show someone, sometimes by the time I get to them it's already changed to a new one.

Problem with devcontainer.json

devcontainer.json does not build in JetBrains IDE 2024.1 and VSCode.

JetBrains IDE Welcome screen -> DevContainers -> New DevContainer (from VCS Project, Docker must be installed.) Insert the git@ link of the repository with devcontainer.json. -> "Build container and Continue"
image
image

How do I use this?

Hi, sorry I'm a bit of a beginner here, but could you please provide some examples of how to use this? Perhaps as a card?

Better sensor icon would be nice

Hi, not sure how much you are planning to update this integration as it is marked as an example, but it would be nice if the default icon for the sensor would be a bit more random or "joke-y". The default eye looks a bit weird.

image

When looking on MDI for icons the ones shown when searching for "emoj" are probably most suitable.

It would even be better if it would be possible to change the icon yourself as a user, but that currently does not work as the sensor does not have a uniqueid.

image

EDIT: I am dumb; I can actually override it easily in the new Tile card instead of the entity settings. But still a nicer default would be cool.

suggestion for card to use please

Thank you for this integration :-). What is the best card for it? I'm using the entity card, but it shows the first couple of characters of the joke in a rather big font and I need to click it to read the whole joke; is there a way to see the whole joke text without needing to click :-)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.